diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..76a524f9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +--- +stages: + - deploy + +deploy: + image: + name: alpine/git + entrypoint: [""] + stage: deploy + environment: + name: production + url: https://new.discours.io + only: + - main + script: + - mkdir ~/.ssh + - echo "${HOST_KEY}" > ~/.ssh/known_hosts + - echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa + - chmod 0400 ~/.ssh/id_rsa + - git remote add github git@github.com:Discours/discoursio-webapp.git + - git push github HEAD:main diff --git a/package-lock.json b/package-lock.json index ddf88072..5253f9c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,10 +66,10 @@ "@tiptap/extension-underline": "2.0.3", "@tiptap/extension-youtube": "2.0.3", "@types/express": "4.17.17", - "@types/node": "20.1.0", + "@types/node": "20.1.1", "@types/uuid": "9.0.1", - "@typescript-eslint/eslint-plugin": "5.59.2", - "@typescript-eslint/parser": "5.59.2", + "@typescript-eslint/eslint-plugin": "5.59.5", + "@typescript-eslint/parser": "5.59.5", "@urql/core": "3.2.2", "@urql/devtools": "2.0.3", "@urql/exchange-graphcache": "5.2.0", @@ -126,7 +126,7 @@ "prosemirror-schema-list": "1.2.2", "prosemirror-state": "1.4.2", "prosemirror-view": "1.30.2", - "rollup": "3.21.5", + "rollup": "3.21.6", "rollup-plugin-visualizer": "5.9.0", "sass": "1.62.1", "solid-js": "1.7.5", @@ -145,7 +145,7 @@ "unique-names-generator": "4.7.1", "uuid": "9.0.0", "vite": "4.3.5", - "vite-plugin-sass-dts": "1.3.4", + "vite-plugin-sass-dts": "1.3.5", "vite-plugin-solid": "2.7.0", "vite-plugin-ssr": "0.4.123", "wonka": "6.3.1", @@ -6406,9 +6406,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz", - "integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz", + "integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -6521,15 +6521,15 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", - "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz", + "integrity": "sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/type-utils": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/type-utils": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -6588,14 +6588,14 @@ "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.2.tgz", - "integrity": "sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", + "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "debug": "^4.3.4" }, "engines": { @@ -6615,13 +6615,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", - "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", + "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2" + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6632,13 +6632,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", - "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz", + "integrity": "sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/typescript-estree": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -6659,9 +6659,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", - "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", + "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6672,13 +6672,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", - "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", + "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6732,17 +6732,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", - "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.5.tgz", + "integrity": "sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -6791,12 +6791,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", - "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", + "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/types": "5.59.5", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -17894,9 +17894,9 @@ } }, "node_modules/rollup": { - "version": "3.21.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.5.tgz", - "integrity": "sha512-a4NTKS4u9PusbUJcfF4IMxuqjFzjm6ifj76P54a7cKnvVzJaG12BLVR+hgU2YDGHzyMMQNxLAZWuALsn8q2oQg==", + "version": "3.21.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.6.tgz", + "integrity": "sha512-SXIICxvxQxR3D4dp/3LDHZIJPC8a4anKMHd4E3Jiz2/JnY+2bEjqrOokAauc5ShGVNFHlEFjBXAXlaxkJqIqSg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -19907,9 +19907,9 @@ } }, "node_modules/vite-plugin-sass-dts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/vite-plugin-sass-dts/-/vite-plugin-sass-dts-1.3.4.tgz", - "integrity": "sha512-wwyI6mRahYEX71CXOOo3f1dRcb70qUmcppvrhJ3elSypxHcmU4qbN9RTZIwCrA6155Pz4Beh/t1yuPt6M0yr/g==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/vite-plugin-sass-dts/-/vite-plugin-sass-dts-1.3.5.tgz", + "integrity": "sha512-yGm5uRTDq1qc17ZMJV0bQRgxNfw2a/Ejqc/T2NOILXmcR1z9zHpqqo1FwoDddyTV87GDQZYldqKZOE4O5bGBOw==", "dev": true, "dependencies": { "postcss-js": "^4.0.1" @@ -25287,9 +25287,9 @@ "dev": true }, "@types/node": { - "version": "20.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz", - "integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz", + "integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A==", "dev": true }, "@types/normalize-package-data": { @@ -25402,15 +25402,15 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", - "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz", + "integrity": "sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/type-utils": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/type-utils": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -25446,53 +25446,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.2.tgz", - "integrity": "sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", + "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", - "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", + "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2" + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5" } }, "@typescript-eslint/type-utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", - "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz", + "integrity": "sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/typescript-estree": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", - "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", + "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", - "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", + "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -25527,17 +25527,17 @@ } }, "@typescript-eslint/utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", - "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.5.tgz", + "integrity": "sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -25569,12 +25569,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", - "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", + "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/types": "5.59.5", "eslint-visitor-keys": "^3.3.0" } }, @@ -33810,9 +33810,9 @@ } }, "rollup": { - "version": "3.21.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.5.tgz", - "integrity": "sha512-a4NTKS4u9PusbUJcfF4IMxuqjFzjm6ifj76P54a7cKnvVzJaG12BLVR+hgU2YDGHzyMMQNxLAZWuALsn8q2oQg==", + "version": "3.21.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.6.tgz", + "integrity": "sha512-SXIICxvxQxR3D4dp/3LDHZIJPC8a4anKMHd4E3Jiz2/JnY+2bEjqrOokAauc5ShGVNFHlEFjBXAXlaxkJqIqSg==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -35292,9 +35292,9 @@ } }, "vite-plugin-sass-dts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/vite-plugin-sass-dts/-/vite-plugin-sass-dts-1.3.4.tgz", - "integrity": "sha512-wwyI6mRahYEX71CXOOo3f1dRcb70qUmcppvrhJ3elSypxHcmU4qbN9RTZIwCrA6155Pz4Beh/t1yuPt6M0yr/g==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/vite-plugin-sass-dts/-/vite-plugin-sass-dts-1.3.5.tgz", + "integrity": "sha512-yGm5uRTDq1qc17ZMJV0bQRgxNfw2a/Ejqc/T2NOILXmcR1z9zHpqqo1FwoDddyTV87GDQZYldqKZOE4O5bGBOw==", "dev": true, "requires": { "postcss-js": "^4.0.1" diff --git a/package.json b/package.json index 9cc5d2af..0bd48e79 100644 --- a/package.json +++ b/package.json @@ -86,10 +86,10 @@ "@tiptap/extension-underline": "2.0.3", "@tiptap/extension-youtube": "2.0.3", "@types/express": "4.17.17", - "@types/node": "20.1.0", + "@types/node": "20.1.1", "@types/uuid": "9.0.1", - "@typescript-eslint/eslint-plugin": "5.59.2", - "@typescript-eslint/parser": "5.59.2", + "@typescript-eslint/eslint-plugin": "5.59.5", + "@typescript-eslint/parser": "5.59.5", "@urql/core": "3.2.2", "@urql/devtools": "2.0.3", "@urql/exchange-graphcache": "5.2.0", @@ -146,7 +146,7 @@ "prosemirror-schema-list": "1.2.2", "prosemirror-state": "1.4.2", "prosemirror-view": "1.30.2", - "rollup": "3.21.5", + "rollup": "3.21.6", "rollup-plugin-visualizer": "5.9.0", "sass": "1.62.1", "solid-js": "1.7.5", @@ -165,7 +165,7 @@ "unique-names-generator": "4.7.1", "uuid": "9.0.0", "vite": "4.3.5", - "vite-plugin-sass-dts": "1.3.4", + "vite-plugin-sass-dts": "1.3.5", "vite-plugin-solid": "2.7.0", "vite-plugin-ssr": "0.4.123", "wonka": "6.3.1", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index ec796cd4..42365efb 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -102,7 +102,7 @@ "Independant magazine with an open horizontal cooperation about culture, science and society": "Independant magazine with an open horizontal cooperation about culture, science and society", "Introduce": "Introduction", "Invalid email": "Check if your email is correct", - "Invalid image link": "Invalid image link", + "Invalid image URL": "Invalid image URL", "Invalid url format": "Invalid url format", "Invite co-authors": "Invite co-authors", "Invite to collab": "Invite to Collab", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 850bd9c9..45e46b74 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -107,7 +107,7 @@ "Independant magazine with an open horizontal cooperation about culture, science and society": "Независимый журнал с открытой горизонтальной редакцией о культуре, науке и обществе", "Introduce": "Представление", "Invalid email": "Проверьте правильность ввода почты", - "Invalid image link": "Некорректная ссылка на изображение", + "Invalid image URL": "Некорректная ссылка на изображение", "Invalid url format": "Неверный формат ссылки", "Invite co-authors": "Пригласить соавторов", "Invite experts": "Пригласить экспертов", diff --git a/src/components/Draft/Draft.tsx b/src/components/Draft/Draft.tsx index c259d627..2486b65c 100644 --- a/src/components/Draft/Draft.tsx +++ b/src/components/Draft/Draft.tsx @@ -5,9 +5,8 @@ import { Icon } from '../_shared/Icon' import { formatDate } from '../../utils' import formatDateTime from '../../utils/formatDateTime' import { useLocalize } from '../../context/localize' -import { getPagePath, openPage } from '@nanostores/router' +import { getPagePath } from '@nanostores/router' import { router } from '../../stores/router' -import { useEditorContext } from '../../context/editor' type Props = { class?: string diff --git a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx index bb90fc93..67dc0842 100644 --- a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx +++ b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx @@ -25,13 +25,6 @@ const embedData = async (data) => { } } -const validateEmbed = async (value) => { - const iframeData = (await HTMLParser(value, false)) as JSONContent - if (iframeData.type !== 'iframe') { - return - } -} - export const EditorFloatingMenu = (props: FloatingMenuProps) => { const { t } = useLocalize() const [selectedMenuItem, setSelectedMenuItem] = createSignal() @@ -43,6 +36,13 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => { props.editor.chain().focus().setIframe(emb).run() } + const validateEmbed = async (value) => { + const iframeData = (await HTMLParser(value, false)) as JSONContent + if (iframeData.type !== 'iframe') { + return t('Error') + } + } + createEffect(() => { switch (selectedMenuItem()) { case 'image': { @@ -102,7 +102,6 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => { onClear={() => setSelectedMenuItem()} validate={validateEmbed} onSubmit={handleEmbedFormSubmit} - errorMessage={t('Error')} /> diff --git a/src/components/Editor/EditorFloatingMenu/Menu/Menu.module.scss b/src/components/Editor/EditorFloatingMenu/Menu/Menu.module.scss index b9c4d52e..6d47e83d 100644 --- a/src/components/Editor/EditorFloatingMenu/Menu/Menu.module.scss +++ b/src/components/Editor/EditorFloatingMenu/Menu/Menu.module.scss @@ -1,6 +1,7 @@ .Menu { display: flex; flex-direction: row; + .icon { opacity: 0.5; display: block; diff --git a/src/components/Editor/InlineForm/InlineForm.module.scss b/src/components/Editor/InlineForm/InlineForm.module.scss index 33109c7a..0c24a99e 100644 --- a/src/components/Editor/InlineForm/InlineForm.module.scss +++ b/src/components/Editor/InlineForm/InlineForm.module.scss @@ -4,8 +4,7 @@ .form { display: flex; - flex-direction: row; - flex-wrap: nowrap; + flex-flow: row nowrap; padding: 6px 11px; width: 100%; diff --git a/src/components/Editor/InlineForm/InlineForm.tsx b/src/components/Editor/InlineForm/InlineForm.tsx index 486999f9..0305038e 100644 --- a/src/components/Editor/InlineForm/InlineForm.tsx +++ b/src/components/Editor/InlineForm/InlineForm.tsx @@ -7,11 +7,10 @@ type Props = { onClose: () => void onClear?: () => void onSubmit: (value: string) => void - validate?: (value: string) => string | Promise | Promise | Promise + validate?: (value: string) => string | Promise initialValue?: string showInput?: boolean placeholder: string - errorMessage: string autoFocus?: boolean } @@ -26,17 +25,15 @@ export const InlineForm = (props: Props) => { const handleSaveButtonClick = async () => { if (props.validate) { - const checkValid = await props.validate(formValue()) - if (checkValid) { - props.onSubmit(formValue()) - props.onClose() - } else { - setFormValueError(props.errorMessage) + const errorMessage = await props.validate(formValue()) + if (errorMessage) { + setFormValueError(errorMessage) + return } - } else { - props.onSubmit(formValue()) - props.onClose() } + + props.onSubmit(formValue()) + props.onClose() } const handleKeyPress = async (event) => { diff --git a/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.module.scss b/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.module.scss deleted file mode 100644 index 15caa9aa..00000000 --- a/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.module.scss +++ /dev/null @@ -1,46 +0,0 @@ -.LinkForm { - position: relative; - - .form { - display: flex; - flex-flow: row nowrap; - padding: 6px 11px; - - input { - margin: 0 12px 0 0; - padding: 0; - flex: 1; - border: none; - min-width: 200px; - display: block; - - &::placeholder { - color: rgba(#000, 0.3); - } - - &:focus { - outline: none; - } - } - } - - .linkError { - padding: 6px 11px; - color: red; - font-size: 0.7em; - position: absolute; - bottom: -3rem; - left: 0; - right: 0; - height: 0; - background: #fff; - box-shadow: 0 4px 10px rgba(#000, 0.25); - opacity: 0; - transition: height 0.3s ease-in-out, opacity 0.3s ease-in-out; - - &.visible { - height: 32px; - opacity: 1; - } - } -} diff --git a/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.tsx b/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.tsx deleted file mode 100644 index ce91c801..00000000 --- a/src/components/Editor/TextBubbleMenu/LinkForm/LinkForm.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import styles from './LinkForm.module.scss' -import { Icon } from '../../../_shared/Icon' -import { createEditorTransaction } from 'solid-tiptap' -import validateUrl from '../../../../utils/validateUrl' -import type { Editor } from '@tiptap/core' -import { createSignal } from 'solid-js' -import { useLocalize } from '../../../../context/localize' -import { clsx } from 'clsx' - -type Props = { - editor: Editor - onClose: () => void -} - -export const LinkForm = (props: Props) => { - const { t } = useLocalize() - const [url, setUrl] = createSignal('') - const [linkError, setLinkError] = createSignal('') - - const currentUrl = createEditorTransaction( - () => props.editor, - (editor) => { - return (editor && editor.getAttributes('link').href) || '' - } - ) - - const clearLinkForm = () => { - if (currentUrl()) { - props.editor.chain().focus().unsetLink().run() - } - setUrl('') - props.onClose() - } - - const handleUrlInput = (value) => { - setUrl(value) - } - - const handleSaveButtonClick = () => { - if (!validateUrl(url())) { - setLinkError(t('Invalid url format')) - return - } - - props.editor.chain().focus().setLink({ href: url() }).run() - props.onClose() - } - - const handleKeyPress = (event) => { - event.preventDefault() - setLinkError('') - const key = event.key - - if (key === 'Enter') { - handleSaveButtonClick() - } - - if (key === 'Esc') { - clearLinkForm() - } - } - - return ( -
-
- handleKeyPress(e)} - onInput={(e) => handleUrlInput(e.currentTarget.value)} - /> - - -
- -
{linkError()}
-
- ) -} diff --git a/src/components/Editor/TextBubbleMenu/LinkForm/index.ts b/src/components/Editor/TextBubbleMenu/LinkForm/index.ts deleted file mode 100644 index 43fe9b0d..00000000 --- a/src/components/Editor/TextBubbleMenu/LinkForm/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { LinkForm } from './LinkForm' diff --git a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx index f0ae262b..0f7065dc 100644 --- a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx +++ b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx @@ -6,7 +6,7 @@ import { clsx } from 'clsx' import { createEditorTransaction } from 'solid-tiptap' import { useLocalize } from '../../../context/localize' import { InlineForm } from '../InlineForm' -import validateImage from '../../../utils/validateUrl' +import { validateUrl } from '../../../utils/validateUrl' type BubbleMenuProps = { editor: Editor @@ -83,10 +83,9 @@ export const TextBubbleMenu = (props: BubbleMenuProps) => { placeholder={t('Enter URL address')} initialValue={currentUrl() ?? ''} onClear={handleClearLinkForm} - validate={(value) => (validateImage(value) ? '' : t('Invalid url format'))} + validate={(value) => (validateUrl(value) ? '' : t('Invalid url format'))} onSubmit={handleLinkFormSubmit} onClose={() => setLinkEditorOpen(false)} - errorMessage={t('Error')} /> diff --git a/src/components/Editor/UploadModalContent/UploadModalContent.module.scss b/src/components/Editor/UploadModalContent/UploadModalContent.module.scss index 6121e375..c8cbb0ee 100644 --- a/src/components/Editor/UploadModalContent/UploadModalContent.module.scss +++ b/src/components/Editor/UploadModalContent/UploadModalContent.module.scss @@ -40,8 +40,8 @@ to right, rgba(#fff, 0) 0%, rgba(#fff, 0.8) 50%, - rgba(128, 186, 232, 0) 99%, - rgba(125, 185, 232, 0) 100% + rgb(128 186 232 / 0%) 99%, + rgb(125 185 232 / 0%) 100% ); } } @@ -89,6 +89,7 @@ 0% { transform: translateX(-100%); } + 100% { transform: translateX(100%); } diff --git a/src/components/Editor/UploadModalContent/UploadModalContent.tsx b/src/components/Editor/UploadModalContent/UploadModalContent.tsx index 4f6bbc34..9be2138d 100644 --- a/src/components/Editor/UploadModalContent/UploadModalContent.tsx +++ b/src/components/Editor/UploadModalContent/UploadModalContent.tsx @@ -113,9 +113,8 @@ export const UploadModalContent = (props: Props) => { hideModal() props.onClose() }} - validate={(value) => verifyImg(value)} + validate={async (value) => ((await verifyImg(value)) ? '' : t('Invalid image URL'))} onSubmit={handleImageFormSubmit} - errorMessage={t('Invalid image link')} /> diff --git a/src/components/Editor/extensions/Figure.ts b/src/components/Editor/extensions/Figure.ts index 5b517bec..f1dca237 100644 --- a/src/components/Editor/extensions/Figure.ts +++ b/src/components/Editor/extensions/Figure.ts @@ -118,26 +118,32 @@ export const Figure = Node.create({ const tracker = new Tracker(tr) - return commands.forEach(images, ({ node, pos }) => { - const mapResult = tracker.map(pos) + return commands.forEach( + // eslint-disable-next-line unicorn/no-array-callback-reference + images, + // eslint-disable-next-line unicorn/no-array-method-this-argument + ({ node, pos }) => { + // eslint-disable-next-line unicorn/no-array-callback-reference + const mapResult = tracker.map(pos) - if (mapResult.deleted) { - return false + if (mapResult.deleted) { + return false + } + + const range = { + from: mapResult.position, + to: mapResult.position + node.nodeSize + } + + return commands.insertContentAt(range, { + type: this.name, + attrs: { + src: node.attrs.src + }, + content: [{ type: 'text', text: node.attrs.src }] + }) } - - const range = { - from: mapResult.position, - to: mapResult.position + node.nodeSize - } - - return commands.insertContentAt(range, { - type: this.name, - attrs: { - src: node.attrs.src - }, - content: [{ type: 'text', text: node.attrs.src }] - }) - }) + ) }, figureToImage: () => @@ -153,25 +159,31 @@ export const Figure = Node.create({ const tracker = new Tracker(tr) - return commands.forEach(figures, ({ node, pos }) => { - const mapResult = tracker.map(pos) + return commands.forEach( + // eslint-disable-next-line unicorn/no-array-callback-reference + figures, + // eslint-disable-next-line unicorn/no-array-method-this-argument + ({ node, pos }) => { + // eslint-disable-next-line unicorn/no-array-callback-reference + const mapResult = tracker.map(pos) - if (mapResult.deleted) { - return false - } - - const range = { - from: mapResult.position, - to: mapResult.position + node.nodeSize - } - - return commands.insertContentAt(range, { - type: 'image', - attrs: { - src: node.attrs.src + if (mapResult.deleted) { + return false } - }) - }) + + const range = { + from: mapResult.position, + to: mapResult.position + node.nodeSize + } + + return commands.insertContentAt(range, { + type: 'image', + attrs: { + src: node.attrs.src + } + }) + } + ) } } }, diff --git a/src/components/Editor/extensions/TrailingNode.ts b/src/components/Editor/extensions/TrailingNode.ts index 4b293dcd..fa399c79 100644 --- a/src/components/Editor/extensions/TrailingNode.ts +++ b/src/components/Editor/extensions/TrailingNode.ts @@ -1,7 +1,6 @@ import { Extension } from '@tiptap/core' import { Plugin, PluginKey } from '@tiptap/pm/state' -// @ts-ignore function nodeEqualsType({ types, node }) { return (Array.isArray(types) && types.includes(node.type)) || node.type === types } diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index 5aa1b028..2e0ba124 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -11,7 +11,7 @@ import { showModal, useWarningsStore } from '../../stores/ui' import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient' import { useSession } from '../../context/session' import { useLocalize } from '../../context/localize' -import { getPagePath, openPage } from '@nanostores/router' +import { getPagePath } from '@nanostores/router' import { Button } from '../_shared/Button' import { useEditorContext } from '../../context/editor' diff --git a/src/components/Views/DraftsView/DraftsView.tsx b/src/components/Views/DraftsView/DraftsView.tsx index 72457675..ef9c2923 100644 --- a/src/components/Views/DraftsView/DraftsView.tsx +++ b/src/components/Views/DraftsView/DraftsView.tsx @@ -10,7 +10,7 @@ import { openPage } from '@nanostores/router' import { router } from '../../../stores/router' export const DraftsView = () => { - const { isAuthenticated, isSessionLoaded, user } = useSession() + const { isAuthenticated, isSessionLoaded } = useSession() const [drafts, setDrafts] = createSignal([]) diff --git a/src/components/Views/Edit.module.scss b/src/components/Views/Edit.module.scss index 91e165a1..675cbd1a 100644 --- a/src/components/Views/Edit.module.scss +++ b/src/components/Views/Edit.module.scss @@ -14,6 +14,7 @@ .shoutCardCoverContainer { position: relative; width: 100%; + .shoutCardCover { height: 0; overflow: hidden; diff --git a/src/components/Views/Edit.tsx b/src/components/Views/Edit.tsx index 66b9dc13..5a4876d6 100644 --- a/src/components/Views/Edit.tsx +++ b/src/components/Views/Edit.tsx @@ -38,7 +38,6 @@ export const EditView = (props: EditViewProps) => { formErrors, actions: { setForm, setFormErrors } } = useEditorContext() - const [isSlugChanged, setIsSlugChanged] = createSignal(false) setForm({ shoutId: props.shout.id, @@ -78,10 +77,6 @@ export const EditView = (props: EditViewProps) => { const handleSlugInputChange = (e) => { const slug = e.currentTarget.value - - if (slug !== form.slug) { - setIsSlugChanged(true) - } setForm('slug', slug) } diff --git a/src/pages/profile/profileSettings.page.tsx b/src/pages/profile/profileSettings.page.tsx index 3519c3ab..9dbc5324 100644 --- a/src/pages/profile/profileSettings.page.tsx +++ b/src/pages/profile/profileSettings.page.tsx @@ -5,7 +5,7 @@ import { For, createSignal, Show, onMount } from 'solid-js' import { clsx } from 'clsx' import styles from './Settings.module.scss' import { useProfileForm } from '../../context/profile' -import validateUrl from '../../utils/validateUrl' +import { validateUrl } from '../../utils/validateUrl' import { createFileUploader } from '@solid-primitives/upload' import { Loading } from '../../components/_shared/Loading' import { useSession } from '../../context/session' diff --git a/src/styles/app.scss b/src/styles/app.scss index ead2abe7..1f1f76cc 100644 --- a/src/styles/app.scss +++ b/src/styles/app.scss @@ -853,6 +853,7 @@ details { .description { @include font-size(1.4rem); + color: rgba(0 0 0 / 40%); } diff --git a/src/utils/validateUrl.ts b/src/utils/validateUrl.ts index 1afc22ff..9fbe9bb5 100644 --- a/src/utils/validateUrl.ts +++ b/src/utils/validateUrl.ts @@ -1,5 +1,3 @@ -const validateUrl = (value: string) => { +export const validateUrl = (value: string) => { return /^(http|https):\/\/[^ "]+$/.test(value) } - -export default validateUrl