Merge pull request #31 from utopia-os/lint-import

feat(other): lint import
This commit is contained in:
antontranelis 2024-11-08 22:19:43 +01:00 committed by GitHub
commit 47dd9d1767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
111 changed files with 764 additions and 608 deletions

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-commonjs
module.exports = {
env: {
browser: true,
@ -8,8 +9,8 @@ module.exports = {
'eslint:recommended',
'plugin:@eslint-community/eslint-comments/recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:import/recommended',
// 'plugin:import/typescript',
'plugin:import/recommended',
'plugin:import/typescript',
// 'plugin:promise/recommended',
// 'plugin:security/recommended-legacy',
'plugin:react/recommended',
@ -21,7 +22,7 @@ module.exports = {
},
plugins: [
'@typescript-eslint',
// 'import',
'import',
// 'promise',
// 'security',
// 'no-catch-all',
@ -29,10 +30,12 @@ module.exports = {
'react-hooks',
],
settings: {
// 'import/resolver': {
// typescript: true,
// node: true,
// },
'import/resolver': {
typescript: true,
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
@ -58,67 +61,74 @@ module.exports = {
// Optional eslint-comments rule
'@eslint-community/eslint-comments/no-unused-disable': 'error',
'@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
// // import
// 'import/export': 'error',
// 'import/no-deprecated': 'error',
// 'import/no-empty-named-blocks': 'error',
// 'import/no-extraneous-dependencies': 'error',
// 'import/no-mutable-exports': 'error',
// 'import/no-unused-modules': 'error',
// 'import/no-named-as-default': 'error',
// 'import/no-named-as-default-member': 'error',
// 'import/no-amd': 'error',
// 'import/no-commonjs': 'error',
// 'import/no-import-module-exports': 'error',
// 'import/no-nodejs-modules': 'off',
// 'import/unambiguous': 'off', // not compatible with scriptless vue files
// 'import/default': 'error',
// 'import/named': 'error',
// 'import/namespace': 'error',
// 'import/no-absolute-path': 'error',
// 'import/no-cycle': 'error',
// 'import/no-dynamic-require': 'error',
// 'import/no-internal-modules': 'off',
// 'import/no-relative-packages': 'error',
// 'import/no-relative-parent-imports': [
// 'error',
// {
// ignore: [
// '#[src,root,components,pages,assets,layouts,queries,stores,plugins,context,types]/*',
// ],
// },
// ],
// 'import/no-self-import': 'error',
// 'import/no-unresolved': 'error',
// 'import/no-useless-path-segments': 'error',
// 'import/no-webpack-loader-syntax': 'error',
// 'import/consiste@typescript-eslint
// {
// json: 'always',
// },
// ],
// 'import/first': 'error',
// 'import/group-exports': 'off',
// 'import/newline-after-import': 'error',
// 'import/no-anonymous-default-export': 'off', // todo - consider to enable again
// 'import/no-default-export': 'off', // incompatible with vite & vike
// 'import/no-duplicates': 'error',
// 'import/no-named-default': 'error',
// 'import/no-namespace': 'error',
// 'import/no-unassigned-import': 'error',
// 'import/order': [
// 'error',
// {
// groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
// 'newlines-between': 'always',
// alphabetize: {
// order: 'asc', // sort in ascending order. Options: ["ignore", "asc", "desc"]
// caseInsensitive: true, // ignore case. Options: [true, false]
// },
// distinctGroup: true,
// },
// ],
// 'import/prefer-default-export': 'off',
// import
'import/export': 'error',
'import/no-deprecated': 'error',
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-mutable-exports': 'error',
'import/no-unused-modules': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-amd': 'error',
'import/no-commonjs': 'error',
'import/no-import-module-exports': 'error',
'import/no-nodejs-modules': 'off',
'import/unambiguous': 'off', // not compatible with scriptless vue files
'import/default': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/no-absolute-path': 'error',
'import/no-cycle': 'error',
'import/no-dynamic-require': 'error',
'import/no-internal-modules': 'off',
'import/no-relative-packages': 'error',
'import/no-relative-parent-imports': [
'error',
{
ignore: ['#[src,root,components,utils]/*'],
},
],
'import/no-self-import': 'error',
'import/no-unresolved': [
'error',
{
ignore: ['react'],
},
],
'import/no-useless-path-segments': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/consistent-type-specifier-style': 'error',
'import/exports-last': 'off',
'import/extensions': [
'error',
'never',
{
json: 'always',
},
],
'import/first': 'error',
'import/group-exports': 'off',
'import/newline-after-import': 'error',
'import/no-anonymous-default-export': 'off', // todo - consider to enable again
'import/no-default-export': 'off', // incompatible with vite & vike
'import/no-duplicates': 'error',
'import/no-named-default': 'error',
'import/no-namespace': 'error',
'import/no-unassigned-import': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'always',
alphabetize: {
order: 'asc', // sort in ascending order. Options: ["ignore", "asc", "desc"]
caseInsensitive: true, // ignore case. Options: [true, false]
},
distinctGroup: true,
},
],
'import/prefer-default-export': 'off',
// // promise
// 'promise/catch-or-return': 'error',
// 'promise/no-return-wrap': 'error',

168
package-lock.json generated
View File

@ -31,10 +31,10 @@
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@types/geojson": "^7946.0.14",
"@types/leaflet": "^1.7.11",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.0.5",
"@types/react-leaflet": "^2.8.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"autoprefixer": "^10.4.14",
@ -42,6 +42,8 @@
"eslint": "^8.24.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.31.8",
@ -288,6 +290,16 @@
"node": ">= 8"
}
},
"node_modules/@nolyfill/is-core-module": {
"version": "1.0.39",
"resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz",
"integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12.4.0"
}
},
"node_modules/@pkgr/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz",
@ -333,8 +345,7 @@
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
"integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/@tanstack/query-core": {
"version": "5.17.8",
@ -391,10 +402,11 @@
}
},
"node_modules/@types/geojson": {
"version": "7946.0.8",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.8.tgz",
"integrity": "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==",
"dev": true
"version": "7946.0.14",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz",
"integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/hast": {
"version": "3.0.3",
@ -416,14 +428,14 @@
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/@types/leaflet": {
"version": "1.7.11",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.7.11.tgz",
"integrity": "sha512-VwAYom2pfIAf/pLj1VR5aLltd4tOtHyvfaJlNYCoejzP2nu52PrMi1ehsLRMUS+bgafmIIKBV1cMfKeS+uJ0Vg==",
"version": "1.9.14",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.14.tgz",
"integrity": "sha512-sx2q6MDJaajwhKeVgPSvqXd8rhNJSTA3tMidQGduZn9S6WBYxDkCpSpV5xXEmSg7Cgdk/5vJGhVF1kMYLzauBg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/geojson": "*"
}
@ -469,16 +481,6 @@
"@types/react": "*"
}
},
"node_modules/@types/react-leaflet": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/@types/react-leaflet/-/react-leaflet-2.8.2.tgz",
"integrity": "sha512-Iel8Vd1bSCD38Yhiqcmm/+9hjPEdd39LFE3tBMbOytq3QAQsC3LDrbo6ifoh8JbpqPbCsQPo9Wx5OELHixEShg==",
"dev": true,
"dependencies": {
"@types/leaflet": "*",
"@types/react": "*"
}
},
"node_modules/@types/semver": {
"version": "7.5.8",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz",
@ -860,7 +862,6 @@
"integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@ -882,7 +883,6 @@
"integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.2.0",
@ -1628,11 +1628,12 @@
}
},
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"version": "4.3.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
"license": "MIT",
"dependencies": {
"ms": "2.1.2"
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
@ -1836,6 +1837,20 @@
"integrity": "sha512-FRHZO+1tUNO4TOPXmlxetkoaIY8uwHzd1kKopK/Gx2SKn1L47wJXWD44wxP5CGRyyP98z/c8e1eBzJrgPeiBOg==",
"dev": true
},
"node_modules/enhanced-resolve": {
"version": "5.17.1",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
"integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/entities": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
@ -2138,7 +2153,6 @@
"integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"debug": "^3.2.7",
"is-core-module": "^2.13.0",
@ -2151,18 +2165,52 @@
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/eslint-import-resolver-typescript": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.3.tgz",
"integrity": "sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==",
"dev": true,
"license": "ISC",
"dependencies": {
"@nolyfill/is-core-module": "1.0.39",
"debug": "^4.3.5",
"enhanced-resolve": "^5.15.0",
"eslint-module-utils": "^2.8.1",
"fast-glob": "^3.3.2",
"get-tsconfig": "^4.7.5",
"is-bun-module": "^1.0.2",
"is-glob": "^4.0.3"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts"
},
"peerDependencies": {
"eslint": "*",
"eslint-plugin-import": "*",
"eslint-plugin-import-x": "*"
},
"peerDependenciesMeta": {
"eslint-plugin-import": {
"optional": true
},
"eslint-plugin-import-x": {
"optional": true
}
}
},
"node_modules/eslint-module-utils": {
"version": "2.12.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz",
"integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"debug": "^3.2.7"
},
@ -2181,7 +2229,6 @@
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ms": "^2.1.1"
}
@ -2215,7 +2262,6 @@
"integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.8",
@ -2250,7 +2296,6 @@
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ms": "^2.1.1"
}
@ -2261,7 +2306,6 @@
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"esutils": "^2.0.2"
},
@ -2771,9 +2815,10 @@
"license": "Apache-2.0"
},
"node_modules/fast-glob": {
"version": "3.2.12",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
"integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
"integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
"license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
@ -3060,7 +3105,6 @@
"integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
@ -3539,6 +3583,29 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-bun-module": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.2.1.tgz",
"integrity": "sha512-AmidtEM6D6NmUiLOvvU7+IePxjEjOzra2h0pSrsfSAcXwl/83zLLXDByafUJy9k/rKK0pvXMLdwKwGHlX2Ke6Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"semver": "^7.6.3"
}
},
"node_modules/is-bun-module/node_modules/semver": {
"version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/is-callable": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
@ -3834,7 +3901,6 @@
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"minimist": "^1.2.0"
},
@ -4672,15 +4738,15 @@
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/mz": {
"version": "2.7.0",
@ -4865,7 +4931,6 @@
"integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"call-bind": "^1.0.7",
"define-properties": "^1.2.1",
@ -6135,7 +6200,6 @@
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"dev": true,
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
@ -6586,7 +6650,6 @@
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=4"
}
@ -6784,6 +6847,16 @@
"node": ">=10.13.0"
}
},
"node_modules/tapable": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@ -6854,7 +6927,6 @@
"integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@types/json5": "^0.0.29",
"json5": "^1.0.2",

View File

@ -19,10 +19,10 @@
"license": "GPL-3.0-only",
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@types/geojson": "^7946.0.14",
"@types/leaflet": "^1.7.11",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.0.5",
"@types/react-leaflet": "^2.8.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"autoprefixer": "^10.4.14",
@ -30,6 +30,8 @@
"eslint": "^8.24.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.31.8",
@ -69,5 +71,11 @@
"remark-breaks": "^4.0.0",
"tributejs": "^5.1.3",
"tw-elements": "^1.0.0"
},
"imports": {
"#components/*": "./src/Components/*",
"#utils/*": "./src/Utils/*",
"#src/*": "./src/*",
"#root/*": "./*"
}
}

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-commonjs
module.exports = {
plugins: {
tailwindcss: {},

View File

@ -1,8 +1,8 @@
import * as React from 'react'
import { AssetsApi } from '#src/types'
import { ContextWrapper } from './ContextWrapper'
import NavBar from './NavBar'
import { SetAppState } from './SetAppState'
import { AssetsApi } from '../../types'
import { ContextWrapper } from './ContextWrapper'
export function AppShell({
appName,

View File

@ -1,6 +1,4 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
import * as React from 'react'
type ContentProps = {
children?: React.ReactNode
}

View File

@ -1,18 +1,20 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ToastContainer } from 'react-toastify'
import { QuestsProvider } from '../Gaming/hooks/useQuests'
import { ClusterRefProvider } from '../Map/hooks/useClusterRef'
import { FilterProvider } from '../Map/hooks/useFilter'
import { ItemsProvider } from '../Map/hooks/useItems'
import { LayersProvider } from '../Map/hooks/useLayers'
import { LeafletRefsProvider } from '../Map/hooks/useLeafletRefs'
import { PermissionsProvider } from '../Map/hooks/usePermissions'
import { SelectPositionProvider } from '../Map/hooks/useSelectPosition'
import { TagsProvider } from '../Map/hooks/useTags'
import { AppStateProvider } from './hooks/useAppState'
import { useContext, createContext } from 'react'
import { BrowserRouter as Router, useLocation } from 'react-router-dom'
import { ToastContainer } from 'react-toastify'
import { QuestsProvider } from '#components/Gaming/hooks/useQuests'
import { ClusterRefProvider } from '#components/Map/hooks/useClusterRef'
import { FilterProvider } from '#components/Map/hooks/useFilter'
import { ItemsProvider } from '#components/Map/hooks/useItems'
import { LayersProvider } from '#components/Map/hooks/useLayers'
import { LeafletRefsProvider } from '#components/Map/hooks/useLeafletRefs'
import { PermissionsProvider } from '#components/Map/hooks/usePermissions'
import { SelectPositionProvider } from '#components/Map/hooks/useSelectPosition'
import { TagsProvider } from '#components/Map/hooks/useTags'
import { AppStateProvider } from './hooks/useAppState'
// Helper context to determine if the ContextWrapper is already present.
const ContextCheckContext = createContext(false)

View File

@ -9,13 +9,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
import { useAuth } from '../Auth'
import { Link, useLocation } from 'react-router-dom'
import { toast } from 'react-toastify'
import QuestionMarkIcon from '@heroicons/react/24/outline/QuestionMarkCircleIcon'
import { useEffect, useRef, useState } from 'react'
import { useItems } from '../Map/hooks/useItems'
import { Item } from '../../types'
import { Link, useLocation } from 'react-router-dom'
import { toast } from 'react-toastify'
import { useAuth } from '#components/Auth'
import { useItems } from '#components/Map/hooks/useItems'
import { Item } from '#src/types'
export default function NavBar({ appName, userType }: { appName: string; userType: string }) {
const { isAuthenticated, user, logout } = useAuth()

View File

@ -1,7 +1,9 @@
import { useSetAppState } from './hooks/useAppState'
import { AssetsApi } from '../../types'
import { useEffect } from 'react'
import { AssetsApi } from '#src/types'
import { useSetAppState } from './hooks/useAppState'
export const SetAppState = ({
assetsApi,
userType,

View File

@ -5,12 +5,12 @@
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import ChevronRightIcon from '@heroicons/react/24/outline/ChevronRightIcon'
import { useRef, useState, useEffect } from 'react'
import { NavLink, useLocation } from 'react-router-dom'
import { Sidenav, initTE } from 'tw-elements'
import SidebarSubmenu from './SidebarSubmenu'
import ChevronRightIcon from '@heroicons/react/24/outline/ChevronRightIcon'
import * as React from 'react'
type route = {
path: string

View File

@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useEffect, useState } from 'react'
import { useItems } from '../Map/hooks/useItems'
import { useItems } from '#components/Map/hooks/useItems'
export const Sitemap = ({ url }: { url: string }) => {
const [sitemap, setSitemap] = useState('')

View File

@ -1,7 +1,8 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-empty-function */
import { useCallback, useState, createContext, useContext } from 'react'
import * as React from 'react'
import { AssetsApi } from '../../../types'
import { AssetsApi } from '#src/types'
interface AppState {
assetsApi: AssetsApi

View File

@ -1,8 +1,9 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-empty-function */
import { useCallback, useState, createContext, useContext } from 'react'
import * as React from 'react'
import { AssetsApi } from '../../../types'
import { AssetsApi } from '#src/types'
type UseAssetManagerResult = ReturnType<typeof useAssetsManager>

View File

@ -6,8 +6,10 @@
import { useEffect, useState } from 'react'
import { Link, useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { MapOverlayPage } from '#components/Templates/MapOverlayPage'
import { useAuth } from './useAuth'
import { MapOverlayPage } from '../Templates'
export function LoginPage() {
const [email, setEmail] = useState<string>('')

View File

@ -4,8 +4,10 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { MapOverlayPage } from '#components/Templates/MapOverlayPage'
import { useAuth } from './useAuth'
import { MapOverlayPage } from '../Templates'
// eslint-disable-next-line react/prop-types
export function RequestPasswordPage({ resetUrl }) {

View File

@ -2,10 +2,11 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { MapOverlayPage } from '#components/Templates/MapOverlayPage'
import { useAuth } from './useAuth'
import { MapOverlayPage } from '../Templates'
export function SetNewPasswordPage() {
const [password, setPassword] = useState<string>('')

View File

@ -5,10 +5,11 @@
/* eslint-disable @typescript-eslint/no-misused-promises */
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { MapOverlayPage } from '#components/Templates/MapOverlayPage'
import { useAuth } from './useAuth'
import { MapOverlayPage } from '../Templates'
export function SignupPage() {
const [email, setEmail] = useState<string>('')

View File

@ -6,8 +6,8 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { createContext, useState, useContext, useEffect } from 'react'
import * as React from 'react'
import { UserApi, UserItem } from '../../types'
import { UserApi, UserItem } from '#src/types'
interface AuthProviderProps {
userApi: UserApi

View File

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as React from 'react'
import { useEffect } from 'react'
export function Modal({

View File

@ -1,9 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { useQuestsOpen, useSetQuestOpen } from './hooks/useQuests'
import { useAuth } from '../Auth'
import { useEffect, useState } from 'react'
import { useItems } from '../Map/hooks/useItems'
import { Item } from '../../types'
import { useAuth } from '#components/Auth'
import { useItems } from '#components/Map/hooks/useItems'
import { Item } from '#src/types'
import { useQuestsOpen, useSetQuestOpen } from './hooks/useQuests'
export function Quests() {
const questsOpen = useQuestsOpen()

View File

@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-empty-function */
import { useCallback, useState, createContext, useContext } from 'react'
import * as React from 'react'
type UseQuestManagerResult = ReturnType<typeof useQuestsManager>

View File

@ -5,9 +5,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import * as React from 'react'
import { useEffect } from 'react'
import { TagView } from '../Templates/TagView'
import { useEffect, useRef, useState } from 'react'
import { TagView } from '#components/Templates/TagView'
export const Autocomplete = ({
inputProps,
@ -22,8 +22,8 @@ export const Autocomplete = ({
pushFilteredSuggestions?: any[]
setFocus?: boolean
}) => {
const [filteredSuggestions, setFilteredSuggestions] = React.useState<any[]>([])
const [heighlightedSuggestion, setHeighlightedSuggestion] = React.useState<number>(0)
const [filteredSuggestions, setFilteredSuggestions] = useState<any[]>([])
const [heighlightedSuggestion, setHeighlightedSuggestion] = useState<number>(0)
useEffect(() => {
pushFilteredSuggestions && setFilteredSuggestions(pushFilteredSuggestions)
@ -33,7 +33,7 @@ export const Autocomplete = ({
setFocus && inputRef.current?.focus()
}, [setFocus])
const inputRef = React.useRef<HTMLInputElement>()
const inputRef = useRef<HTMLInputElement>()
const getSuggestionValue = (suggestion) => suggestion.name

View File

@ -1,5 +1,3 @@
import * as React from 'react'
interface ComboBoxProps {
id?: string
options: string[]

View File

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useState } from 'react'
import InformationCircleIcon from '@heroicons/react/24/outline/InformationCircleIcon'
import * as React from 'react'
import { useState } from 'react'
type SelectBoxProps = {
labelTitle?: string

View File

@ -2,10 +2,10 @@
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
import * as React from 'react'
import { useEffect, useRef, useState } from 'react'
import Tribute from 'tributejs'
import { useTags } from '../Map/hooks/useTags'
import { useTags } from '#components/Map/hooks/useTags'
type TextAreaProps = {
labelTitle?: string

View File

@ -2,7 +2,6 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
import { useEffect, useState } from 'react'
import * as React from 'react'
type InputTextProps = {
labelTitle?: string

View File

@ -1,7 +1,7 @@
import * as React from 'react'
import { Item } from '../../types'
import * as PropTypes from 'prop-types'
import { useEffect } from 'react'
import { node, string } from 'prop-types'
import { Children, cloneElement, isValidElement, useEffect } from 'react'
import { Item } from '#src/types'
export const ItemForm = ({
children,
@ -23,9 +23,9 @@ export const ItemForm = ({
return (
<div>
{children
? React.Children.toArray(children).map((child) =>
React.isValidElement<{ item: Item; test: string }>(child)
? React.cloneElement(child, { item, test: 'test' })
? Children.toArray(children).map((child) =>
isValidElement<{ item: Item; test: string }>(child)
? cloneElement(child, { item, test: 'test' })
: '',
)
: ''}
@ -34,8 +34,8 @@ export const ItemForm = ({
}
ItemForm.propTypes = {
children: PropTypes.node,
__TYPE: PropTypes.string,
children: node,
__TYPE: string,
}
ItemForm.defaultProps = {

View File

@ -1,13 +1,14 @@
import * as React from 'react'
import { Item } from '../../types'
import * as PropTypes from 'prop-types'
import { node, string } from 'prop-types'
import { Children, cloneElement, isValidElement } from 'react'
import { Item } from '#src/types'
export const ItemView = ({ children, item }: { children?: React.ReactNode; item?: Item }) => {
return (
<div>
{children
? React.Children.toArray(children).map((child) =>
React.isValidElement<{ item: Item }>(child) ? React.cloneElement(child, { item }) : '',
? Children.toArray(children).map((child) =>
isValidElement<{ item: Item }>(child) ? cloneElement(child, { item }) : '',
)
: ''}
</div>
@ -15,8 +16,8 @@ export const ItemView = ({ children, item }: { children?: React.ReactNode; item?
}
ItemView.propTypes = {
children: PropTypes.node,
__TYPE: PropTypes.string,
children: node,
__TYPE: string,
}
ItemView.defaultProps = {

View File

@ -7,29 +7,30 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as React from 'react'
import { Popup } from 'leaflet'
import { Children, isValidElement, useEffect, useState } from 'react'
import { Marker, Tooltip, useMap, useMapEvents } from 'react-leaflet'
import { Item, LayerProps, Tag } from '../../types'
import MarkerIconFactory from '../../Utils/MarkerIconFactory'
import { ItemViewPopup } from './Subcomponents/ItemViewPopup'
import { useAllItemsLoaded, useItems, useSetItemsApi, useSetItemsData } from './hooks/useItems'
import { useEffect, useState } from 'react'
import { ItemFormPopup } from './Subcomponents/ItemFormPopup'
import { useLocation } from 'react-router-dom'
import { Item, LayerProps, Tag } from '#src/types'
import { encodeTag } from '#utils/FormatTags'
import { getValue } from '#utils/GetValue'
import { hashTagRegex } from '#utils/HashTagRegex'
import MarkerIconFactory from '#utils/MarkerIconFactory'
import { randomColor } from '#utils/RandomColor'
import {
useFilterTags,
useIsGroupTypeVisible,
useIsLayerVisible,
useVisibleGroupType,
} from './hooks/useFilter'
import { useAddTag, useAllTagsLoaded, useGetItemTags, useTags } from './hooks/useTags'
import { useAllItemsLoaded, useItems, useSetItemsApi, useSetItemsData } from './hooks/useItems'
import { useAddMarker, useAddPopup, useLeafletRefs } from './hooks/useLeafletRefs'
import { Popup } from 'leaflet'
import { useLocation } from 'react-router-dom'
import { getValue } from '../../Utils/GetValue'
import { hashTagRegex } from '../../Utils/HashTagRegex'
import { randomColor } from '../../Utils/RandomColor'
import { encodeTag } from '../../Utils/FormatTags'
import { useSelectPosition, useSetMarkerClicked } from './hooks/useSelectPosition'
import { useAddTag, useAllTagsLoaded, useGetItemTags, useTags } from './hooks/useTags'
import { ItemFormPopup } from './Subcomponents/ItemFormPopup'
import { ItemViewPopup } from './Subcomponents/ItemViewPopup'
export const Layer = ({
data,
@ -335,11 +336,11 @@ export const Layer = ({
position={[latitude, longitude]}
>
{children &&
React.Children.toArray(children).some(
(child) => React.isValidElement(child) && child.props.__TYPE === 'ItemView',
Children.toArray(children).some(
(child) => isValidElement(child) && child.props.__TYPE === 'ItemView',
) ? (
React.Children.toArray(children).map((child) =>
React.isValidElement(child) && child.props.__TYPE === 'ItemView' ? (
Children.toArray(children).map((child) =>
isValidElement(child) && child.props.__TYPE === 'ItemView' ? (
<ItemViewPopup
ref={(r) => {
if (!(item.id in leafletRefs && leafletRefs[item.id].popup === r)) {
@ -383,11 +384,11 @@ export const Layer = ({
{itemFormPopup &&
itemFormPopup.layer.name === name &&
(children &&
React.Children.toArray(children).some(
(child) => React.isValidElement(child) && child.props.__TYPE === 'ItemForm',
Children.toArray(children).some(
(child) => isValidElement(child) && child.props.__TYPE === 'ItemForm',
) ? (
React.Children.toArray(children).map((child) =>
React.isValidElement(child) && child.props.__TYPE === 'ItemForm' ? (
Children.toArray(children).map((child) =>
isValidElement(child) && child.props.__TYPE === 'ItemForm' ? (
<ItemFormPopup
key={setItemFormPopup?.name}
position={itemFormPopup.position}

View File

@ -1,8 +1,9 @@
import * as React from 'react'
import { useEffect } from 'react'
import { ItemsApi, Permission } from '../../types'
import { useAuth } from '#components/Auth'
import { ItemsApi, Permission } from '#src/types'
import { useSetPermissionData, useSetPermissionApi, useSetAdminRole } from './hooks/usePermissions'
import { useAuth } from '../Auth'
export function Permissions({
data,

View File

@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import * as React from 'react'
import { useLayers } from '../hooks/useLayers'
import { useHasUserPermission } from '../hooks/usePermissions'
import { useLayers } from '#components/Map/hooks/useLayers'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
export default function AddButton({
triggerAction,

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import * as L from 'leaflet'
import * as React from 'react'
import { DomEvent } from 'leaflet'
import { createRef, useEffect } from 'react'
export const Control = ({
position,
@ -13,12 +13,12 @@ export const Control = ({
zIndex: string
absolute: boolean
}) => {
const controlContainerRef = React.createRef<HTMLDivElement>()
const controlContainerRef = createRef<HTMLDivElement>()
React.useEffect(() => {
useEffect(() => {
if (controlContainerRef.current !== null) {
L.DomEvent.disableClickPropagation(controlContainerRef.current)
L.DomEvent.disableScrollPropagation(controlContainerRef.current)
DomEvent.disableClickPropagation(controlContainerRef.current)
DomEvent.disableScrollPropagation(controlContainerRef.current)
}
}, [controlContainerRef])

View File

@ -1,14 +1,14 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import {
useAddVisibleGroupType,
useIsGroupTypeVisible,
useToggleVisibleGroupType,
useVisibleGroupType,
} from '../../hooks/useFilter'
import { useEffect } from 'react'
} from '#components/Map/hooks/useFilter'
export function FilterControl() {
const [open, setOpen] = React.useState(false)
const [open, setOpen] = useState(false)
const groupTypes = [
{ text: 'Regional Gruppe', value: 'wuerdekompass' },

View File

@ -1,5 +1,6 @@
import { useNavigate } from 'react-router-dom'
import { useAuth } from '../../../Auth'
import { useAuth } from '#components/Auth'
export const GratitudeControl = () => {
const navigate = useNavigate()

View File

@ -1,9 +1,10 @@
import * as React from 'react'
import { useLayers } from '../../hooks/useLayers'
import { useIsLayerVisible, useToggleVisibleLayer } from '../../hooks/useFilter'
import { useState } from 'react'
import { useIsLayerVisible, useToggleVisibleLayer } from '#components/Map/hooks/useFilter'
import { useLayers } from '#components/Map/hooks/useLayers'
export function LayerControl() {
const [open, setOpen] = React.useState(false)
const [open, setOpen] = useState(false)
const layers = useLayers()

View File

@ -4,12 +4,13 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as L from 'leaflet'
import { useMap, useMapEvents } from 'react-leaflet'
import 'leaflet.locatecontrol'
import 'leaflet.locatecontrol/dist/L.Control.Locate.css'
import { control } from 'leaflet'
import { useEffect, useRef, useState } from 'react'
import { useMap, useMapEvents } from 'react-leaflet'
// eslint-disable-next-line import/no-unassigned-import
import 'leaflet.locatecontrol'
// eslint-disable-next-line import/no-unassigned-import
import 'leaflet.locatecontrol/dist/L.Control.Locate.css'
// Converts leaflet.locatecontrol to a React Component
export const LocateControl = () => {
@ -25,7 +26,7 @@ export const LocateControl = () => {
useEffect(() => {
if (!init.current) {
// @ts-ignore
setLc(L.control.locate().addTo(map))
setLc(control.locate().addTo(map))
init.current = true
}
// eslint-disable-next-line react-hooks/exhaustive-deps

View File

@ -1,5 +1,4 @@
import * as React from 'react'
import { useQuestsOpen, useSetQuestOpen } from '../../../Gaming/hooks/useQuests'
import { useQuestsOpen, useSetQuestOpen } from '#components/Gaming/hooks/useQuests'
export function QuestControl() {
const questsOpen = useQuestsOpen()

View File

@ -10,24 +10,24 @@
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as React from 'react'
import { useAddFilterTag } from '../../hooks/useFilter'
import useWindowDimensions from '../../hooks/useWindowDimension'
import axios from 'axios'
import { LatLng, LatLngBounds, marker } from 'leaflet'
import { useEffect, useRef, useState } from 'react'
import { useMap, useMapEvents } from 'react-leaflet'
import { LatLng, LatLngBounds } from 'leaflet'
import { useDebounce } from '../../hooks/useDebounce'
import { useTags } from '../../hooks/useTags'
import { useItems } from '../../hooks/useItems'
import { useLeafletRefs } from '../../hooks/useLeafletRefs'
import { getValue } from '../../../../Utils/GetValue'
import { LocateControl } from './LocateControl'
import * as L from 'leaflet'
import MarkerIconFactory from '../../../../Utils/MarkerIconFactory'
import { decodeTag } from '../../../../Utils/FormatTags'
import { useLocation, useNavigate } from 'react-router-dom'
import { Item } from '../../../../types'
import { useDebounce } from '#components/Map/hooks/useDebounce'
import { useAddFilterTag } from '#components/Map/hooks/useFilter'
import { useItems } from '#components/Map/hooks/useItems'
import { useLeafletRefs } from '#components/Map/hooks/useLeafletRefs'
import { useTags } from '#components/Map/hooks/useTags'
import useWindowDimensions from '#components/Map/hooks/useWindowDimension'
import { Item } from '#src/types'
import { decodeTag } from '#utils/FormatTags'
import { getValue } from '#utils/GetValue'
import MarkerIconFactory from '#utils/MarkerIconFactory'
import { LocateControl } from './LocateControl'
import { SidebarControl } from './SidebarControl'
export const SearchControl = () => {
@ -206,7 +206,7 @@ export const SearchControl = () => {
key={Math.random()}
onClick={() => {
searchInput.current?.blur()
L.marker(new LatLng(geo.geometry.coordinates[1], geo.geometry.coordinates[0]), {
marker(new LatLng(geo.geometry.coordinates[1], geo.geometry.coordinates[0]), {
icon: MarkerIconFactory('circle', '#777', 'RGBA(35, 31, 32, 0.2)', 'point'),
})
.addTo(map)
@ -272,7 +272,7 @@ export const SearchControl = () => {
<div
className='tw-flex tw-flex-row hover:tw-font-bold tw-cursor-pointer'
onClick={() => {
L.marker(
marker(
new LatLng(extractCoordinates(value)![0], extractCoordinates(value)![1]),
{
icon: MarkerIconFactory('circle', '#777', 'RGBA(35, 31, 32, 0.2)', 'point'),

View File

@ -1,6 +1,5 @@
import * as React from 'react'
import { useFilterTags, useRemoveFilterTag } from '../../hooks/useFilter'
import { decodeTag } from '../../../../Utils/FormatTags'
import { useFilterTags, useRemoveFilterTag } from '#components/Map/hooks/useFilter'
import { decodeTag } from '#utils/FormatTags'
export const TagsControl = () => {
const filterTags = useFilterTags()

View File

@ -7,28 +7,19 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as React from 'react'
import { LatLng } from 'leaflet'
import { Children, cloneElement, isValidElement, useEffect, useRef, useState } from 'react'
import { Popup as LeafletPopup, useMap } from 'react-leaflet'
import { useEffect, useRef, useState } from 'react'
import { useAddItem, useItems, useRemoveItem, useUpdateItem } from '../hooks/useItems'
import { Geometry, LayerProps, Item } from '../../../types'
import { TextAreaInput } from '../../Input/TextAreaInput'
import { TextInput } from '../../Input/TextInput'
import { toast } from 'react-toastify'
import { useResetFilterTags } from '../hooks/useFilter'
import { hashTagRegex } from '../../../Utils/HashTagRegex'
import { randomColor } from '../../../Utils/RandomColor'
import { useAddTag, useTags } from '../hooks/useTags'
import { useAuth } from '../../Auth'
export interface ItemFormPopupProps {
position: LatLng
layer: LayerProps
item?: Item
children?: React.ReactNode
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
}
import { useAuth } from '#components/Auth/useAuth'
import { TextAreaInput } from '#components/Input/TextAreaInput'
import { TextInput } from '#components/Input/TextInput'
import { useResetFilterTags } from '#components/Map/hooks/useFilter'
import { useAddItem, useItems, useRemoveItem, useUpdateItem } from '#components/Map/hooks/useItems'
import { useAddTag, useTags } from '#components/Map/hooks/useTags'
import { Geometry, Item, ItemFormPopupProps } from '#src/types'
import { hashTagRegex } from '#utils/HashTagRegex'
import { randomColor } from '#utils/RandomColor'
export function ItemFormPopup(props: ItemFormPopupProps) {
const [spinner, setSpinner] = useState(false)
@ -168,13 +159,13 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
)}
{props.children ? (
React.Children.toArray(props.children).map((child) =>
React.isValidElement<{
Children.toArray(props.children).map((child) =>
isValidElement<{
item: Item
test: string
setPopupTitle: React.Dispatch<React.SetStateAction<string>>
}>(child)
? React.cloneElement(child, {
? cloneElement(child, {
item: props.item,
key: props.position.toString(),
setPopupTitle,

View File

@ -9,14 +9,15 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import * as React from 'react'
import { Item, ItemsApi } from '../../../../types'
import { useHasUserPermission } from '../../hooks/usePermissions'
import { getValue } from '../../../../Utils/GetValue'
import { useAppState } from '../../../AppShell/hooks/useAppState'
import DialogModal from '../../../Templates/DialogModal'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
import DialogModal from '#components/Templates/DialogModal'
import { Item, ItemsApi } from '#src/types'
import { getValue } from '#utils/GetValue'
export function HeaderView({
item,
api,
@ -48,7 +49,7 @@ export function HeaderView({
truncateSubname?: boolean
showAddress?: boolean
}) {
const [modalOpen, setModalOpen] = React.useState<boolean>(false)
const [modalOpen, setModalOpen] = useState<boolean>(false)
const hasUserPermission = useHasUserPermission()
const navigate = useNavigate()
@ -72,7 +73,7 @@ export function HeaderView({
? getValue(item, itemSubnameField)
: item.layer?.itemSubnameField && item && getValue(item, item.layer.itemSubnameField)
const [address] = React.useState<string>('')
const [address] = useState<string>('')
const params = new URLSearchParams(window.location.search)

View File

@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { Link } from 'react-router-dom'
import { getValue } from '../../../../Utils/GetValue'
import { Item } from '../../../../types'
import { useGetItemTags } from '../../hooks/useTags'
import { useGetItemTags } from '#components/Map/hooks/useTags'
import { Item } from '#src/types'
import { getValue } from '#utils/GetValue'
export const PopupButton = ({
url,

View File

@ -1,4 +1,4 @@
import { Item } from '../../../../types'
import { Item } from '#src/types'
export const PopupCheckboxInput = ({
dataField,

View File

@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/prefer-optional-chain */
import * as React from 'react'
import { TextInput } from '../../../Input'
import { Item } from '../../../../types'
import { TextInput } from '#components/Input'
import { Item } from '#src/types'
interface StartEndInputProps {
item?: Item

View File

@ -1,6 +1,5 @@
import * as React from 'react'
import { TextAreaInput } from '../../../Input'
import { Item } from '../../../../types'
import { TextAreaInput } from '#components/Input'
import { Item } from '#src/types'
export const PopupTextAreaInput = ({
dataField,

View File

@ -1,6 +1,5 @@
import * as React from 'react'
import { TextInput } from '../../../Input'
import { Item } from '../../../../types'
import { TextInput } from '#components/Input'
import { Item } from '#src/types'
export const PopupTextInput = ({
dataField,

View File

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/prefer-optional-chain */
import * as React from 'react'
import { Item } from '../../../../types'
import { Item } from '#src/types'
export const StartEndView = ({ item }: { item?: Item }) => {
return (

View File

@ -7,16 +7,17 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { Item } from '../../../../types'
import { useTags } from '../../hooks/useTags'
import { useAddFilterTag } from '../../hooks/useFilter'
import { hashTagRegex } from '../../../../Utils/HashTagRegex'
import { fixUrls, mailRegex } from '../../../../Utils/ReplaceURLs'
import Markdown from 'react-markdown'
import { getValue } from '../../../../Utils/GetValue'
import remarkBreaks from 'remark-breaks'
import { decodeTag } from '../../../../Utils/FormatTags'
import { memo } from 'react'
import Markdown from 'react-markdown'
import remarkBreaks from 'remark-breaks'
import { useAddFilterTag } from '#components/Map/hooks/useFilter'
import { useTags } from '#components/Map/hooks/useTags'
import { Item } from '#src/types'
import { decodeTag } from '#utils/FormatTags'
import { getValue } from '#utils/GetValue'
import { hashTagRegex } from '#utils/HashTagRegex'
import { fixUrls, mailRegex } from '#utils/ReplaceURLs'
export const TextView = ({
item,

View File

@ -7,19 +7,19 @@
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as React from 'react'
import { LatLng } from 'leaflet'
import { Children, cloneElement, forwardRef, isValidElement, useState } from 'react'
import { Popup as LeafletPopup, useMap } from 'react-leaflet'
import { Item } from '../../../types'
import { ItemFormPopupProps } from './ItemFormPopup'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { useRemoveItem, useUpdateItem } from '#components/Map/hooks/useItems'
import { useSetSelectPosition } from '#components/Map/hooks/useSelectPosition'
import { Item, ItemFormPopupProps } from '#src/types'
import { timeAgo } from '#utils/TimeAgo'
import { HeaderView } from './ItemPopupComponents/HeaderView'
import { TextView } from './ItemPopupComponents/TextView'
import { timeAgo } from '../../../Utils/TimeAgo'
import { useState } from 'react'
import { LatLng } from 'leaflet'
import { useNavigate } from 'react-router-dom'
import { useRemoveItem, useUpdateItem } from '../hooks/useItems'
import { toast } from 'react-toastify'
import { useSetSelectPosition } from '../hooks/useSelectPosition'
export interface ItemViewPopupProps {
item: Item
@ -28,9 +28,9 @@ export interface ItemViewPopupProps {
}
// eslint-disable-next-line react/display-name
export const ItemViewPopup = React.forwardRef((props: ItemViewPopupProps, ref: any) => {
export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) => {
const map = useMap()
const [loading, setLoading] = React.useState<boolean>(false)
const [loading, setLoading] = useState<boolean>(false)
const removeItem = useRemoveItem()
const updadateItem = useUpdateItem()
const navigate = useNavigate()
@ -95,9 +95,9 @@ export const ItemViewPopup = React.forwardRef((props: ItemViewPopupProps, ref: a
/>
<div className='tw-overflow-y-auto tw-overflow-x-hidden tw-max-h-64 fade'>
{props.children ? (
React.Children.toArray(props.children).map((child) =>
React.isValidElement<{ item: Item; test: string }>(child)
? React.cloneElement(child, { item: props.item })
Children.toArray(props.children).map((child) =>
isValidElement<{ item: Item; test: string }>(child)
? cloneElement(child, { item: props.item })
: '',
)
) : (

View File

@ -1,9 +1,10 @@
import * as React from 'react'
import { useEffect } from 'react'
import { ItemsApi, Tag } from '../../types'
import { useSetTagData, useSetTagApi, useTags } from './hooks/useTags'
import { useLocation } from 'react-router-dom'
import { ItemsApi, Tag } from '#src/types'
import { useAddFilterTag, useFilterTags, useResetFilterTags } from './hooks/useFilter'
import { useSetTagData, useSetTagApi, useTags } from './hooks/useTags'
export function Tags({ data, api }: { data?: Tag[]; api?: ItemsApi<Tag> }) {
const setTagData = useSetTagData()

View File

@ -1,6 +1,8 @@
import { UtopiaMapProps } from '../../types'
import { ContextWrapper } from '../AppShell/ContextWrapper'
import { ContextWrapper } from '#components/AppShell/ContextWrapper'
import { UtopiaMapProps } from '#src/types'
import { UtopiaMapInner } from './UtopiaMapInner'
// eslint-disable-next-line import/no-unassigned-import
import 'react-toastify/dist/ReactToastify.css'
function UtopiaMap(props: UtopiaMapProps) {

View File

@ -6,37 +6,49 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { TileLayer, MapContainer, useMapEvents, GeoJSON } from 'react-leaflet'
import 'leaflet/dist/leaflet.css'
import * as React from 'react'
import { UtopiaMapProps } from '../../types'
import './UtopiaMap.css'
import { LatLng } from 'leaflet'
import {
Children,
cloneElement,
createRef,
isValidElement,
useEffect,
useRef,
useState,
} from 'react'
import { TileLayer, MapContainer, useMapEvents, GeoJSON } from 'react-leaflet'
// eslint-disable-next-line import/no-unassigned-import
import 'leaflet/dist/leaflet.css'
import MarkerClusterGroup from 'react-leaflet-cluster'
import AddButton from './Subcomponents/AddButton'
import { useEffect, useRef, useState } from 'react'
import { ItemFormPopupProps } from './Subcomponents/ItemFormPopup'
import { SearchControl } from './Subcomponents/Controls/SearchControl'
import { Control } from './Subcomponents/Controls/Control'
import { Outlet } from 'react-router-dom'
import { TagsControl } from './Subcomponents/Controls/TagsControl'
import { toast } from 'react-toastify'
import { ItemFormPopupProps, UtopiaMapProps } from '#src/types'
// eslint-disable-next-line import/no-unassigned-import
import './UtopiaMap.css'
import { useClusterRef, useSetClusterRef } from './hooks/useClusterRef'
import { useAddVisibleLayer } from './hooks/useFilter'
import { useLayers } from './hooks/useLayers'
import {
useSelectPosition,
useSetMapClicked,
useSetSelectPosition,
} from './hooks/useSelectPosition'
import { useClusterRef, useSetClusterRef } from './hooks/useClusterRef'
import { Feature, Geometry as GeoJSONGeometry } from 'geojson'
import AddButton from './Subcomponents/AddButton'
import { Control } from './Subcomponents/Controls/Control'
import { FilterControl } from './Subcomponents/Controls/FilterControl'
import { LayerControl } from './Subcomponents/Controls/LayerControl'
import { useLayers } from './hooks/useLayers'
import { useAddVisibleLayer } from './hooks/useFilter'
import { GratitudeControl } from './Subcomponents/Controls/GratitudeControl'
import { SelectPosition } from './Subcomponents/SelectPosition'
import { toast } from 'react-toastify'
import { LayerControl } from './Subcomponents/Controls/LayerControl'
import { SearchControl } from './Subcomponents/Controls/SearchControl'
import { TagsControl } from './Subcomponents/Controls/TagsControl'
import { TextView } from './Subcomponents/ItemPopupComponents/TextView'
import { SelectPosition } from './Subcomponents/SelectPosition'
const mapDivRef = React.createRef()
import type { Feature, Geometry as GeoJSONGeometry } from 'geojson'
const mapDivRef = createRef()
export function UtopiaMapInner({
height = '500px',
@ -147,13 +159,13 @@ export function UtopiaMapInner({
maxClusterRadius={50}
removeOutsideVisibleBounds={false}
>
{React.Children.toArray(children).map((child) =>
React.isValidElement<{
{Children.toArray(children).map((child) =>
isValidElement<{
setItemFormPopup: React.Dispatch<React.SetStateAction<ItemFormPopupProps>>
itemFormPopup: ItemFormPopupProps | null
clusterRef: React.MutableRefObject<undefined>
}>(child)
? React.cloneElement(child, { setItemFormPopup, itemFormPopup, clusterRef })
? cloneElement(child, { setItemFormPopup, itemFormPopup, clusterRef })
: child,
)}
</MarkerClusterGroup>

View File

@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as React from 'react'
import { createContext, useContext, useState } from 'react'
type UseClusterRefManagerResult = ReturnType<typeof useClusterRefManager>

View File

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { useEffect } from 'react'
import { useTimeout } from './useTimeout'
export const useDebounce = (callback, delay, deps) => {

View File

@ -1,13 +1,15 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable no-case-declarations */
import { useCallback, useReducer, createContext, useContext } from 'react'
import * as React from 'react'
import { LayerProps, Tag } from '../../../types'
import { useLayers } from './useLayers'
import { useCallback, useReducer, createContext, useContext, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { LayerProps, Tag } from '#src/types'
import { useLayers } from './useLayers'
import useWindowDimensions from './useWindowDimension'
type ActionType =
@ -118,7 +120,7 @@ function useFilterManager(initialTags: Tag[]): {
[],
)
const [searchPhrase, searchPhraseSet] = React.useState<string>('')
const [searchPhrase, searchPhraseSet] = useState<string>('')
const addFilterTag = useCallback((tag: Tag) => {
const params = new URLSearchParams(location.search)

View File

@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/require-await */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
@ -7,9 +8,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-misused-promises */
import { useCallback, useReducer, createContext, useContext, useState } from 'react'
import * as React from 'react'
import { Item, LayerProps } from '../../../types'
import { toast } from 'react-toastify'
import { Item, LayerProps } from '#src/types'
import { useAddLayer } from './useLayers'
type ActionType =

View File

@ -1,7 +1,8 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-empty-function */
import { useCallback, useReducer, createContext, useContext } from 'react'
import * as React from 'react'
import { LayerProps } from '../../../types'
import { LayerProps } from '#src/types'
interface ActionType {
type: 'ADD LAYER'

View File

@ -1,9 +1,10 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-empty-function */
import { useCallback, useReducer, createContext, useContext } from 'react'
import * as React from 'react'
import { Item } from '../../../types'
import { Marker, Popup } from 'leaflet'
import { useCallback, useReducer, createContext, useContext } from 'react'
import { Item } from '#src/types'
interface LeafletRef {
item: Item

View File

@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-misused-promises */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-empty-function */
@ -6,10 +7,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useCallback, useReducer, createContext, useContext } from 'react'
import * as React from 'react'
import { Item, ItemsApi, LayerProps, Permission, PermissionAction } from '../../../types'
import { useAuth } from '../../Auth'
import { useCallback, useReducer, createContext, useContext, useState } from 'react'
import { useAuth } from '#components/Auth/useAuth'
import { Item, ItemsApi, LayerProps, Permission, PermissionAction } from '#src/types'
type ActionType = { type: 'ADD'; permission: Permission } | { type: 'REMOVE'; id: string }
@ -51,7 +52,7 @@ function usePermissionsManager(initialPermissions: Permission[]): {
}
}, initialPermissions)
const [adminRole, setAdminRole] = React.useState<string | null>(null)
const [adminRole, setAdminRole] = useState<string | null>(null)
const { user } = useAuth()
const setPermissionApi = useCallback(async (api: ItemsApi<Permission>) => {

View File

@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/no-empty-function */
@ -7,14 +8,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import * as React from 'react'
import { createContext, useContext, useEffect, useState } from 'react'
import { Geometry, Item, LayerProps } from '../../../types'
import { useUpdateItem } from './useItems'
import { toast } from 'react-toastify'
import { useHasUserPermission } from './usePermissions'
import { LatLng } from 'leaflet'
import { ItemFormPopupProps } from '../Subcomponents/ItemFormPopup'
import { createContext, useContext, useEffect, useState } from 'react'
import { toast } from 'react-toastify'
import { Geometry, Item, LayerProps, ItemFormPopupProps } from '#src/types'
import { useUpdateItem } from './useItems'
import { useHasUserPermission } from './usePermissions'
interface PolygonClickedProps {
position: LatLng

View File

@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-misused-promises */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-empty-function */
@ -9,10 +10,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { useCallback, useReducer, createContext, useContext, useState } from 'react'
import * as React from 'react'
import { Item, ItemsApi, Tag } from '../../../types'
import { hashTagRegex } from '../../../Utils/HashTagRegex'
import { getValue } from '../../../Utils/GetValue'
import { Item, ItemsApi, Tag } from '#src/types'
import { getValue } from '#utils/GetValue'
import { hashTagRegex } from '#utils/HashTagRegex'
type ActionType = { type: 'ADD'; tag: Tag } | { type: 'REMOVE'; id: string }
@ -55,7 +56,7 @@ function useTagsManager(initialTags: Tag[]): {
}
}, initialTags)
const [api, setApi] = React.useState<ItemsApi<Tag>>({} as ItemsApi<Tag>)
const [api, setApi] = useState<ItemsApi<Tag>>({} as ItemsApi<Tag>)
const setTagApi = useCallback(async (api: ItemsApi<Tag>) => {
setApi(api)

View File

@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useMap } from 'react-leaflet'
export const setItemLocation = () => {

View File

@ -5,23 +5,25 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { useItems, useUpdateItem, useAddItem } from '../Map/hooks/useItems'
import { useEffect, useState } from 'react'
import { getValue } from '../../Utils/GetValue'
import { useAuth } from '../Auth'
import { useAddTag, useGetItemTags, useTags } from '../Map/hooks/useTags'
import { useLocation, useNavigate } from 'react-router-dom'
import { Item, Tag } from '../../types'
import { MapOverlayPage } from '../Templates'
import { useLayers } from '../Map/hooks/useLayers'
import { useHasUserPermission } from '../Map/hooks/usePermissions'
import { OnepagerForm } from './Templates/OnepagerForm'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { useAuth } from '#components/Auth'
import { useItems, useUpdateItem, useAddItem } from '#components/Map/hooks/useItems'
import { useLayers } from '#components/Map/hooks/useLayers'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
import { useAddTag, useGetItemTags, useTags } from '#components/Map/hooks/useTags'
import { MapOverlayPage } from '#components/Templates'
import { Item, Tag } from '#src/types'
import { getValue } from '#utils/GetValue'
import { linkItem, onUpdateItem, unlinkItem } from './itemFunctions'
import { FormHeader } from './Subcomponents/FormHeader'
import { FlexForm } from './Templates/FlexForm'
import { OnepagerForm } from './Templates/OnepagerForm'
import { SimpleForm } from './Templates/SimpleForm'
import { TabsForm } from './Templates/TabsForm'
import { FormHeader } from './Subcomponents/FormHeader'
import { useAppState } from '../AppShell/hooks/useAppState'
import { FlexForm } from './Templates/FlexForm'
export function ProfileForm() {
const [state, setState] = useState({

View File

@ -7,26 +7,28 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { MapOverlayPage } from '../Templates'
import { useItems, useRemoveItem, useUpdateItem } from '../Map/hooks/useItems'
import { useLocation, useNavigate } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { Item, ItemsApi, Tag } from '../../types'
import { useMap } from 'react-leaflet'
import { LatLng } from 'leaflet'
import { useHasUserPermission } from '../Map/hooks/usePermissions'
import { HeaderView } from '../Map/Subcomponents/ItemPopupComponents/HeaderView'
import { useSelectPosition, useSetSelectPosition } from '../Map/hooks/useSelectPosition'
import { useClusterRef } from '../Map/hooks/useClusterRef'
import { useLeafletRefs } from '../Map/hooks/useLeafletRefs'
import { getValue } from '../../Utils/GetValue'
import { TabsView } from './Templates/TabsView'
import { useEffect, useState } from 'react'
import { useMap } from 'react-leaflet'
import { useLocation, useNavigate } from 'react-router-dom'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { useClusterRef } from '#components/Map/hooks/useClusterRef'
import { useItems, useRemoveItem, useUpdateItem } from '#components/Map/hooks/useItems'
import { useLeafletRefs } from '#components/Map/hooks/useLeafletRefs'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
import { useSelectPosition, useSetSelectPosition } from '#components/Map/hooks/useSelectPosition'
import { useTags } from '#components/Map/hooks/useTags'
import { HeaderView } from '#components/Map/Subcomponents/ItemPopupComponents/HeaderView'
import { MapOverlayPage } from '#components/Templates'
import { Item, ItemsApi, Tag } from '#src/types'
import { getValue } from '#utils/GetValue'
import { handleDelete, linkItem, unlinkItem } from './itemFunctions'
import { FlexView } from './Templates/FlexView'
import { OnepagerView } from './Templates/OnepagerView'
import { SimpleView } from './Templates/SimpleView'
import { handleDelete, linkItem, unlinkItem } from './itemFunctions'
import { useTags } from '../Map/hooks/useTags'
import { FlexView } from './Templates/FlexView'
import { useAppState } from '../AppShell/hooks/useAppState'
import { TabsView } from './Templates/TabsView'
export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi<any> }) {
const [item, setItem] = useState<Item>()

View File

@ -3,14 +3,15 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useState } from 'react'
import { useHasUserPermission } from '../../Map/hooks/usePermissions'
import DialogModal from '../../Templates/DialogModal'
import { useItems } from '../../Map/hooks/useItems'
import { HeaderView } from '../../Map/Subcomponents/ItemPopupComponents/HeaderView'
import { Item } from '../../../types'
import { TextInput } from '../../Input'
import { getValue } from '../../../Utils/GetValue'
import { useGetItemTags } from '../../Map/hooks/useTags'
import { TextInput } from '#components/Input'
import { useItems } from '#components/Map/hooks/useItems'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
import { useGetItemTags } from '#components/Map/hooks/useTags'
import { HeaderView } from '#components/Map/Subcomponents/ItemPopupComponents/HeaderView'
import DialogModal from '#components/Templates/DialogModal'
import { Item } from '#src/types'
import { getValue } from '#utils/GetValue'
export function ActionButton({
item,

View File

@ -1,14 +1,18 @@
/* eslint-disable react/prop-types */
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
import * as React from 'react'
import { useState, useCallback, useRef } from 'react'
import ReactCrop, { Crop, centerCrop, makeAspectCrop } from 'react-image-crop'
import { useAppState } from '../../AppShell/hooks/useAppState'
import { ReactCrop, centerCrop, makeAspectCrop } from 'react-image-crop'
import { useAppState } from '#components/AppShell/hooks/useAppState'
// eslint-disable-next-line import/no-unassigned-import
import 'react-image-crop/dist/ReactCrop.css'
import DialogModal from '../../Templates/DialogModal'
import DialogModal from '#components/Templates/DialogModal'
import type { Crop } from 'react-image-crop'
interface AvatarWidgetProps {
avatar: string

View File

@ -3,10 +3,11 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { useCallback, useEffect, useRef, useState } from 'react'
import * as React from 'react'
import { HexColorPicker } from 'react-colorful'
// eslint-disable-next-line import/no-unassigned-import
import './ColorPicker.css'
import useClickOutside from '../hooks/useClickOutside'
import useClickOutside from '#components/Profile/hooks/useClickOutside'
// eslint-disable-next-line react/prop-types
export const ColorPicker = ({ color, onChange, className }) => {
@ -16,7 +17,7 @@ export const ColorPicker = ({ color, onChange, className }) => {
const close = useCallback(() => toggle(false), [])
useClickOutside(popover, close)
const colorPickerRef = React.useRef<HTMLDivElement>(null)
const colorPickerRef = useRef<HTMLDivElement>(null)
useEffect(() => {
// Füge dem Color-Picker explizit Event-Listener hinzu

View File

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import * as React from 'react'
import { TextInput } from '../../Input'
import { FormState } from '../Templates/OnepagerForm'
import { TextInput } from '#components/Input'
import { FormState } from '#src/types'
export const ContactInfoForm = ({
state,

View File

@ -3,11 +3,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
import { Link } from 'react-router-dom'
import { useAppState } from '../../AppShell/hooks/useAppState'
import { Item } from '../../../types'
import { useEffect, useState } from 'react'
import { useItems } from '../../Map/hooks/useItems'
import { Link } from 'react-router-dom'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { useItems } from '#components/Map/hooks/useItems'
import { Item } from '#src/types'
export const ContactInfoView = ({ item, heading }: { item: Item; heading: string }) => {
const appState = useAppState()

View File

@ -3,7 +3,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable react/prop-types */
import { TextInput } from '../../Input'
import { TextInput } from '#components/Input'
import { AvatarWidget } from './AvatarWidget'
import { ColorPicker } from './ColorPicker'

View File

@ -1,4 +1,5 @@
import { Item } from '../../../types'
import { Item } from '#src/types'
import SocialShareBar from './SocialShareBar'
export const GroupSubHeaderView = ({

View File

@ -1,11 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import * as React from 'react'
import ComboBoxInput from '../../Input/ComboBoxInput'
import { Item } from '../../../types'
import { useEffect } from 'react'
import { FormState } from '../Templates/OnepagerForm'
import ComboBoxInput from '#components/Input/ComboBoxInput'
import { Item, FormState } from '#src/types'
interface groupType {
groupTypes_id: {

View File

@ -6,9 +6,10 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { useEffect } from 'react'
import { getValue } from '../../../Utils/GetValue'
import { Item } from '../../../types'
import { useAppState } from '../../AppShell/hooks/useAppState'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { Item } from '#src/types'
import { getValue } from '#utils/GetValue'
export function LinkedItemsHeaderView({
item,

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { LayerProps } from '../../../types'
import { useHasUserPermission } from '../../Map/hooks/usePermissions'
import { useHasUserPermission } from '#components/Map/hooks/usePermissions'
import { LayerProps } from '#src/types'
export function PlusButton({
layer,

View File

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import * as React from 'react'
import { PopupStartEndInput } from '../../Map'
import { Item } from '../../../types'
import { PopupStartEndInput } from '#components/Map'
import { Item } from '#src/types'
export const ProfileStartEndForm = ({
item,

View File

@ -1,6 +1,5 @@
import * as React from 'react'
import { StartEndView } from '../../Map'
import { Item } from '../../../types'
import { StartEndView } from '#components/Map'
import { Item } from '#src/types'
export const ProfileStartEndView = ({ item }: { item: Item }) => {
return (

View File

@ -2,12 +2,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as React from 'react'
import { TextAreaInput } from '../../Input'
import { FormState } from '../Templates/OnepagerForm'
import { getValue } from '../../../Utils/GetValue'
import { useEffect, useState } from 'react'
import { TextAreaInput } from '#components/Input'
import { FormState } from '#src/types'
import { getValue } from '#utils/GetValue'
export const ProfileTextForm = ({
state,
setState,

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { Item } from '../../../types'
import { getValue } from '../../../Utils/GetValue'
import { TextView } from '../../Map'
import { TextView } from '#components/Map'
import { Item } from '#src/types'
import { getValue } from '#utils/GetValue'
export const ProfileTextView = ({
item,

View File

@ -1,4 +1,5 @@
import { toast } from 'react-toastify'
import SocialShareButton from './SocialShareButton'
const SocialShareBar = ({

View File

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as React from 'react'
import { cloneElement } from 'react'
const platformConfigs = {
facebook: {
@ -106,7 +107,7 @@ const SocialShareButton = ({
}}
title={`share link on ${platform}`}
>
{React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })}
{cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })}
</a>
)
}

View File

@ -4,13 +4,13 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as React from 'react'
import { useEffect, useState } from 'react'
import { useTags } from '../../Map/hooks/useTags'
import { Tag } from '../../../types'
import { Autocomplete } from '../../Input/Autocomplete'
import { randomColor } from '../../../Utils/RandomColor'
import { decodeTag, encodeTag } from '../../../Utils/FormatTags'
import { Autocomplete } from '#components/Input/Autocomplete'
import { useTags } from '#components/Map/hooks/useTags'
import { Tag } from '#src/types'
import { decodeTag, encodeTag } from '#utils/FormatTags'
import { randomColor } from '#utils/RandomColor'
// eslint-disable-next-line react/prop-types
export const TagsWidget = ({ placeholder, containerStyle, defaultTags, onUpdate }) => {

View File

@ -2,13 +2,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as React from 'react'
import { Item } from '../../../types'
import { FormState } from './OnepagerForm'
import { GroupSubheaderForm } from '../Subcomponents/GroupSubheaderForm'
import { ContactInfoForm } from '../Subcomponents/ContactInfoForm'
import { ProfileTextForm } from '../Subcomponents/ProfileTextForm'
import { ProfileStartEndForm } from '../Subcomponents/ProfileStartEndForm'
import { ContactInfoForm } from '#components/Profile/Subcomponents/ContactInfoForm'
import { GroupSubheaderForm } from '#components/Profile/Subcomponents/GroupSubheaderForm'
import { ProfileStartEndForm } from '#components/Profile/Subcomponents/ProfileStartEndForm'
import { ProfileTextForm } from '#components/Profile/Subcomponents/ProfileTextForm'
import { Item, FormState } from '#src/types'
const componentMap = {
groupSubheaders: GroupSubheaderForm,

View File

@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { GroupSubHeaderView } from '../Subcomponents/GroupSubHeaderView'
import { ProfileTextView } from '../Subcomponents/ProfileTextView'
import { ContactInfoView } from '../Subcomponents/ContactInfoView'
import { Item } from '../../../types'
import { ProfileStartEndView } from '../Subcomponents/ProfileStartEndView'
import { ContactInfoView } from '#components/Profile/Subcomponents/ContactInfoView'
import { GroupSubHeaderView } from '#components/Profile/Subcomponents/GroupSubHeaderView'
import { ProfileStartEndView } from '#components/Profile/Subcomponents/ProfileStartEndView'
import { ProfileTextView } from '#components/Profile/Subcomponents/ProfileTextView'
import { Item } from '#src/types'
const componentMap = {
groupSubheaders: GroupSubHeaderView,

View File

@ -1,28 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import * as React from 'react'
import { Item, Tag } from '../../../types'
import { TextAreaInput } from '../../Input'
import { GroupSubheaderForm } from '../Subcomponents/GroupSubheaderForm'
import { ContactInfoForm } from '../Subcomponents/ContactInfoForm'
export interface FormState {
color: string
id: string
group_type: string
status: string
name: string
subname: string
text: string
contact: string
telephone: string
next_appointment: string
image: string
marker_icon: string
offers: Tag[]
needs: Tag[]
relations: Item[]
}
import { TextAreaInput } from '#components/Input'
import { ContactInfoForm } from '#components/Profile/Subcomponents/ContactInfoForm'
import { GroupSubheaderForm } from '#components/Profile/Subcomponents/GroupSubheaderForm'
import { FormState, Item } from '#src/types'
export const OnepagerForm = ({
item,

View File

@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { Item } from '../../../types'
import { TextView } from '../../Map'
import { ContactInfoView } from '../Subcomponents/ContactInfoView'
import { GroupSubHeaderView } from '../Subcomponents/GroupSubHeaderView'
import { TextView } from '#components/Map'
import { ContactInfoView } from '#components/Profile/Subcomponents/ContactInfoView'
import { GroupSubHeaderView } from '#components/Profile/Subcomponents/GroupSubHeaderView'
import { Item } from '#src/types'
export const OnepagerView = ({ item }: { item: Item }) => {
return (

View File

@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { TextAreaInput } from '../../Input'
import { TextAreaInput } from '#components/Input'
// eslint-disable-next-line react/prop-types
export const SimpleForm = ({ state, setState }) => {

View File

@ -1,6 +1,5 @@
import * as React from 'react'
import { TextView } from '../../Map'
import { Item } from '../../../types'
import { TextView } from '#components/Map'
import { Item } from '#src/types'
export const SimpleView = ({ item }: { item: Item }) => {
return (

View File

@ -7,13 +7,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable react/prop-types */
import { useCallback, useEffect, useState } from 'react'
import { TextAreaInput } from '../../Input'
import { PopupStartEndInput, TextView } from '../../Map'
import { ActionButton } from '../Subcomponents/ActionsButton'
import { LinkedItemsHeaderView } from '../Subcomponents/LinkedItemsHeaderView'
import { TagsWidget } from '../Subcomponents/TagsWidget'
import { useNavigate } from 'react-router-dom'
import { useUpdateItem } from '../../Map/hooks/useItems'
import { TextAreaInput } from '#components/Input'
import { PopupStartEndInput, TextView } from '#components/Map'
import { useUpdateItem } from '#components/Map/hooks/useItems'
import { ActionButton } from '#components/Profile/Subcomponents/ActionsButton'
import { LinkedItemsHeaderView } from '#components/Profile/Subcomponents/LinkedItemsHeaderView'
import { TagsWidget } from '#components/Profile/Subcomponents/TagsWidget'
export const TabsForm = ({
item,

View File

@ -6,17 +6,18 @@
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { StartEndView, TextView } from '../../Map'
import { TagView } from '../../Templates/TagView'
import { LinkedItemsHeaderView } from '../Subcomponents/LinkedItemsHeaderView'
import { ActionButton } from '../Subcomponents/ActionsButton'
import { useCallback, useEffect, useRef, useState } from 'react'
import { useAddFilterTag } from '../../Map/hooks/useFilter'
import { Item, Tag } from '../../../types'
import { Link, useNavigate } from 'react-router-dom'
import { useItems } from '../../Map/hooks/useItems'
import { useAppState } from '../../AppShell/hooks/useAppState'
import { timeAgo } from '../../../Utils/TimeAgo'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { StartEndView, TextView } from '#components/Map'
import { useAddFilterTag } from '#components/Map/hooks/useFilter'
import { useItems } from '#components/Map/hooks/useItems'
import { ActionButton } from '#components/Profile/Subcomponents/ActionsButton'
import { LinkedItemsHeaderView } from '#components/Profile/Subcomponents/LinkedItemsHeaderView'
import { TagView } from '#components/Templates/TagView'
import { Item, Tag } from '#src/types'
import { timeAgo } from '#utils/TimeAgo'
export const TabsView = ({
attestations,

View File

@ -1,14 +1,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-floating-promises */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import * as React from 'react'
import { MapOverlayPage } from '../Templates'
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useState } from 'react'
import { UserItem } from '../../types'
import { toast } from 'react-toastify'
import { useAuth } from '../Auth'
import { TextInput } from '../Input'
import { useAuth } from '#components/Auth'
import { TextInput } from '#components/Input'
import { MapOverlayPage } from '#components/Templates'
import { UserItem } from '#src/types'
export function UserSettings() {
const { user, updateUser, loading /* token */ } = useAuth()
@ -21,7 +21,7 @@ export function UserSettings() {
const navigate = useNavigate()
React.useEffect(() => {
useEffect(() => {
setId(user?.id ? user.id : '')
setEmail(user?.email ? user.email : '')
setPassword(user?.password ? user.password : '')

View File

@ -9,13 +9,13 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as React from 'react'
import { Item } from '../../types'
import { encodeTag } from '../../Utils/FormatTags'
import { hashTagRegex } from '../../Utils/HashTagRegex'
import { randomColor } from '../../Utils/RandomColor'
import { toast } from 'react-toastify'
import { Item } from '#src/types'
import { encodeTag } from '#utils/FormatTags'
import { hashTagRegex } from '#utils/HashTagRegex'
import { randomColor } from '#utils/RandomColor'
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
export const submitNewItem = async (

View File

@ -7,16 +7,17 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as React from 'react'
import { MapOverlayPage } from './MapOverlayPage'
import { useItems } from '../Map/hooks/useItems'
import { useAppState } from '../AppShell/hooks/useAppState'
import { EmojiPicker } from './EmojiPicker'
import { useNavigate } from 'react-router-dom'
import { useRef, useState, useEffect } from 'react'
import { Item, ItemsApi } from '../../types'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { useAppState } from '#components/AppShell/hooks/useAppState'
import { useItems } from '#components/Map/hooks/useItems'
import { Item, ItemsApi } from '#src/types'
import { EmojiPicker } from './EmojiPicker'
import { MapOverlayPage } from './MapOverlayPage'
export const AttestationForm = ({ api }: { api?: ItemsApi<any> }) => {
const items = useItems()
const appState = useAppState()

View File

@ -1,5 +1,5 @@
import { Link } from 'react-router-dom'
import * as React from 'react'
import { TitleCard } from './TitleCard'
export function CardPage({

View File

@ -4,8 +4,9 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
import { useState } from 'react'
import { timeAgo } from '../../Utils/TimeAgo'
import { Item } from '../../types'
import { Item } from '#src/types'
import { timeAgo } from '#utils/TimeAgo'
export const DateUserInfo = ({ item }: { item: Item }) => {
const [infoExpanded, setInfoExpanded] = useState<boolean>(false)

View File

@ -1,4 +1,3 @@
import * as React from 'react'
import { MouseEvent, useEffect, useRef } from 'react'
const isClickInsideRectangle = (e: MouseEvent, element: HTMLElement) => {

View File

@ -4,13 +4,15 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { DateUserInfo } from './DateUserInfo'
import { StartEndView, TextView } from '../Map'
import { HeaderView } from '../Map/Subcomponents/ItemPopupComponents/HeaderView'
import { Item } from '../../types'
import { useNavigate } from 'react-router-dom'
import { getValue } from '../../Utils/GetValue'
import useWindowDimensions from '../Map/hooks/useWindowDimension'
import { StartEndView, TextView } from '#components/Map'
import useWindowDimensions from '#components/Map/hooks/useWindowDimension'
import { HeaderView } from '#components/Map/Subcomponents/ItemPopupComponents/HeaderView'
import { Item } from '#src/types'
import { getValue } from '#utils/GetValue'
import { DateUserInfo } from './DateUserInfo'
export const ItemCard = ({
i,

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import * as L from 'leaflet'
import * as React from 'react'
import { DomEvent } from 'leaflet'
import { createRef, useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
export function MapOverlayPage({
@ -20,17 +20,17 @@ export function MapOverlayPage({
const navigate = useNavigate()
const overlayRef = React.createRef<HTMLDivElement>()
const backdropRef = React.createRef<HTMLDivElement>()
const overlayRef = createRef<HTMLDivElement>()
const backdropRef = createRef<HTMLDivElement>()
React.useEffect(() => {
useEffect(() => {
if (overlayRef.current !== null) {
L.DomEvent.disableClickPropagation(overlayRef.current)
L.DomEvent.disableScrollPropagation(overlayRef.current)
DomEvent.disableClickPropagation(overlayRef.current)
DomEvent.disableScrollPropagation(overlayRef.current)
}
if (backdropRef.current !== null && backdrop) {
L.DomEvent.disableClickPropagation(backdropRef.current)
L.DomEvent.disableScrollPropagation(backdropRef.current)
DomEvent.disableClickPropagation(backdropRef.current)
DomEvent.disableScrollPropagation(backdropRef.current)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [overlayRef, backdropRef])

View File

@ -4,13 +4,15 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { useEffect, useState } from 'react'
import { useItems } from '../Map/hooks/useItems'
import { Tag } from '../../types'
import { useTags } from '../Map/hooks/useTags'
import { getValue } from '../../Utils/GetValue'
import { useNavigate } from 'react-router-dom'
import { useItems } from '#components/Map/hooks/useItems'
import { useTags } from '#components/Map/hooks/useTags'
import { Tag } from '#src/types'
import { getValue } from '#utils/GetValue'
import { MapOverlayPage } from './MapOverlayPage'
import { TagView } from './TagView'
import { useNavigate } from 'react-router-dom'
function groupAndCount(arr) {
const grouped = arr.reduce((acc, obj) => {

View File

@ -1,10 +1,11 @@
import * as React from 'react'
import { useState } from 'react'
import { add, format, parse, startOfToday, sub } from 'date-fns'
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline'
import { MapOverlayPage } from './MapOverlayPage'
import { add, format, parse, startOfToday, sub } from 'date-fns'
import { useState } from 'react'
import { LUNAR_MONTH, getLastNewMoon, getNextNewMoon } from '#utils/Moon'
import { CircleLayout } from './CircleLayout'
import { LUNAR_MONTH, getLastNewMoon, getNextNewMoon } from '../../Utils/Moon'
import { MapOverlayPage } from './MapOverlayPage'
export const MoonCalendar = () => {
const today = startOfToday()

View File

@ -6,23 +6,25 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { useEffect, useRef, useState } from 'react'
import { Item } from '../../types'
import { PopupStartEndInput } from '../Map'
import { PlusButton } from '../Profile/Subcomponents/PlusButton'
import { TextInput, TextAreaInput } from '../Input'
import { useAddTag, useGetItemTags, useTags } from '../Map/hooks/useTags'
import { toast } from 'react-toastify'
import { hashTagRegex } from '../../Utils/HashTagRegex'
import { randomColor } from '../../Utils/RandomColor'
import { useAuth } from '../Auth'
import { useLayers } from '../Map/hooks/useLayers'
import { MapOverlayPage } from './MapOverlayPage'
import { useAddItem, useItems, useRemoveItem } from '../Map/hooks/useItems'
import { useAuth } from '#components/Auth/useAuth'
import { TextInput, TextAreaInput } from '#components/Input'
import { PopupStartEndInput } from '#components/Map'
import { useFilterTags } from '#components/Map/hooks/useFilter'
import { useAddItem, useItems, useRemoveItem } from '#components/Map/hooks/useItems'
import { useLayers } from '#components/Map/hooks/useLayers'
import { useAddTag, useGetItemTags, useTags } from '#components/Map/hooks/useTags'
import { Control } from '#components/Map/Subcomponents/Controls/Control'
import { SearchControl } from '#components/Map/Subcomponents/Controls/SearchControl'
import { TagsControl } from '#components/Map/Subcomponents/Controls/TagsControl'
import { PlusButton } from '#components/Profile/Subcomponents/PlusButton'
import { Item } from '#src/types'
import { hashTagRegex } from '#utils/HashTagRegex'
import { randomColor } from '#utils/RandomColor'
import { ItemCard } from './ItemCard'
import { Control } from '../Map/Subcomponents/Controls/Control'
import { SearchControl } from '../Map/Subcomponents/Controls/SearchControl'
import { TagsControl } from '../Map/Subcomponents/Controls/TagsControl'
import { useFilterTags } from '../Map/hooks/useFilter'
import { MapOverlayPage } from './MapOverlayPage'
export const OverlayItemsIndexPage = ({
url,

Some files were not shown because too many files have changed in this diff Show More