From 11548eed6cea5289a82067512d30d6f87534ee23 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Tue, 24 May 2022 16:33:06 +0200 Subject: [PATCH 01/21] feat(description): support for markdown --- client/package.json | 1 + .../AppDescription/AppDescription.js | 30 +- .../AppDescription/AppDescription.module.css | 13 + .../Apps/AppCards/AppCardItem/AppCardItem.js | 26 +- .../AppCardItem/AppCardItem.module.css | 7 + yarn.lock | 534 +++++++++++++++++- 6 files changed, 588 insertions(+), 23 deletions(-) create mode 100644 client/src/components/AppDescription/AppDescription.module.css diff --git a/client/package.json b/client/package.json index 6540e1c72..06a687e42 100644 --- a/client/package.json +++ b/client/package.json @@ -29,6 +29,7 @@ "query-string": "^7.0.1", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-markdown": "^8.0.3", "react-redux": "^7.2.4", "react-router-dom": "^5.2.1", "redux": "^4.1.1", diff --git a/client/src/components/AppDescription/AppDescription.js b/client/src/components/AppDescription/AppDescription.js index fbb02c76c..5360af7d3 100644 --- a/client/src/components/AppDescription/AppDescription.js +++ b/client/src/components/AppDescription/AppDescription.js @@ -1,15 +1,23 @@ +import PropTypes from 'prop-types' +import ReactMarkdown from 'react-markdown' +import styles from './AppDescription.module.css' + const AppDescription = ({ description, paragraphClassName }) => { - const lines = description.split('\n') - return lines.map((line, index) => { - if (!line.trim()) { - return
- } - return ( -

- {line} -

- ) - }) + return ( +
+ + {description} + +
+ ) +} + +AppDescription.propTypes = { + description: PropTypes.string, + paragraphClassName: PropTypes.string, } export default AppDescription diff --git a/client/src/components/AppDescription/AppDescription.module.css b/client/src/components/AppDescription/AppDescription.module.css new file mode 100644 index 000000000..df6dbdda3 --- /dev/null +++ b/client/src/components/AppDescription/AppDescription.module.css @@ -0,0 +1,13 @@ + +.markdownDescription h1,h2,h3,h4,h5,h6 { + font-size: 16px; +} + +.markdownDescription a{ + color: var(--colors-blue600); +} + +.markdownDescription a:hover { + color: var(--colors-blue700); + text-decoration: underline; +} diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js index 21016ae66..4b52d01f9 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js @@ -1,18 +1,11 @@ import PropTypes from 'prop-types' import React from 'react' +import ReactMarkdown from 'react-markdown' import { Link } from 'react-router-dom' import styles from './AppCardItem.module.css' import config from 'config' import AppIcon from 'src/components/AppIcon/AppIcon' -const summarise = text => { - const maxLength = 120 - if (text.length > maxLength) { - return text.slice(0, maxLength) + '…' - } - return text -} - const AppCardItem = ({ id, name, developer, type, description, images }) => { const logo = images.find(elem => elem.logo) @@ -32,12 +25,27 @@ const AppCardItem = ({ id, name, developer, type, description, images }) => {

- {summarise(description)} + + + {description} + +

) } +const Summarise = ({ children }) => { + return
{children}
+} + +Summarise.propTypes = { + children: PropTypes.node, +} + AppCardItem.propTypes = { developer: PropTypes.shape({ name: PropTypes.string, diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css index cbe826fd8..76d1f337b 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css @@ -54,3 +54,10 @@ .coreAppIcon { width: 25px } + +.summarise { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 4fd93bf21..9a1ba5b9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2645,6 +2645,13 @@ dependencies: "@types/node" "*" +"@types/debug@^4.0.0": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" + integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== + dependencies: + "@types/ms" "*" + "@types/eslint-scope@^3.7.0": version "3.7.0" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86" @@ -2714,6 +2721,13 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hast@^2.0.0": + version "2.3.4" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.4.tgz#8aa5ef92c117d20d974a82bdfb6a648b08c0bafc" + integrity sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g== + dependencies: + "@types/unist" "*" + "@types/hoist-non-react-statics@^3.3.0": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -2744,6 +2758,18 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/mdast@^3.0.0": + version "3.0.10" + resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af" + integrity sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA== + dependencies: + "@types/unist" "*" + +"@types/mdurl@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" + integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -2759,6 +2785,11 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/ms@*": + version "0.7.31" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" + integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== + "@types/node@*": version "13.7.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d" @@ -2779,6 +2810,11 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== +"@types/prop-types@^15.0.0": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + "@types/q@^1.5.1": version "1.5.4" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" @@ -2831,6 +2867,11 @@ "@types/mime" "^1" "@types/node" "*" +"@types/unist@*", "@types/unist@^2.0.0": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" + integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== + "@ungap/promise-all-settled@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" @@ -3533,6 +3574,11 @@ babelify@10.0.0: resolved "https://registry.yarnpkg.com/babelify/-/babelify-10.0.0.tgz#fe73b1a22583f06680d8d072e25a1e0d1d1d7fb5" integrity sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg== +bail@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" + integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -4170,6 +4216,11 @@ change-case@^2.3.0: upper-case "^1.1.1" upper-case-first "^1.1.0" +character-entities@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.1.tgz#98724833e1e27990dee0bd0f2b8a859c3476aac7" + integrity sha512-OzmutCf2Kmc+6DrFrrPS8/tDh2+DpnrfzdICHWhcVC9eOd0N1PXmQEE1a8iM4IziIAG+8tmTq3K+oo0ubH6RRQ== + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -4418,6 +4469,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz#d4c25abb679b7751c880be623c1179780fe1dd98" + integrity sha512-G5yTt3KQN4Yn7Yk4ed73hlZ1evrFKXeUW3086p3PRFNp7m2vIjI6Pg+Kgb+oyzhd9F2qdcoj67+y3SdxL5XWsg== + commander@^2.20.0, commander@^2.7.1, commander@^2.9.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -5039,6 +5095,13 @@ debug@^3.0.1, debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.0.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -5062,6 +5125,13 @@ decimal.js@^10.3.1: resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== +decode-named-character-reference@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.1.tgz#57b2bd9112659cacbc449d3577d7dadb8e1f3d1b" + integrity sha512-YV/0HQHreRwKb7uBopyIkLG17jG6Sv2qUchk9qSoVJ2f+flwRsPNBO0hAnjt6mTNYUT+vw9Gy2ihXg4sUWPi2w== + dependencies: + character-entities "^2.0.0" + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -5227,7 +5297,7 @@ deps-sort@^2.0.0: subarg "^1.0.0" through2 "^2.0.0" -dequal@2.0.2: +dequal@2.0.2, dequal@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.2.tgz#85ca22025e3a87e65ef75a7a437b35284a7e319d" integrity sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug== @@ -6089,7 +6159,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.2: +extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -6961,6 +7031,11 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hast-util-whitespace@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz#4fc1086467cc1ef5ba20673cb6b03cec3a970f1c" + integrity sha512-Pkw+xBHuV6xFeJprJe2BBEoDV+AvQySaz3pPDRUs5PNZEMQjpXJJueqrpcHIXxnWTcAGi/UOCgVShlkY6kLoqg== + he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -7319,6 +7394,11 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" +inline-style-parser@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" + integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== + inquirer@^7.3.3: version "7.3.3" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" @@ -7470,6 +7550,11 @@ is-buffer@^1.1.0, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-buffer@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + is-callable@^1.1.4, is-callable@^1.2.3, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" @@ -7714,6 +7799,11 @@ is-plain-obj@^3.0.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== +is-plain-obj@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.0.0.tgz#06c0999fd7574edf5a906ba5644ad0feb3a84d22" + integrity sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw== + is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -8211,6 +8301,11 @@ kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +kleur@^4.0.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" + integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== + knex@^0.95.10: version "0.95.10" resolved "https://registry.yarnpkg.com/knex/-/knex-0.95.10.tgz#9c41a4f69309bc437f79985cbc0a1e7a3208483e" @@ -8577,6 +8672,54 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdast-util-definitions@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.0.tgz#b6d10ef00a3c4cf191e8d9a5fa58d7f4a366f817" + integrity sha512-5hcR7FL2EuZ4q6lLMUK5w4lHT2H3vqL9quPvYZ/Ku5iifrirfMHiGdhxdXMUbUkDmz5I+TYMd7nbaxUhbQkfpQ== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + unist-util-visit "^3.0.0" + +mdast-util-from-markdown@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz#84df2924ccc6c995dec1e2368b2b208ad0a76268" + integrity sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + decode-named-character-reference "^1.0.0" + mdast-util-to-string "^3.1.0" + micromark "^3.0.0" + micromark-util-decode-numeric-character-reference "^1.0.0" + micromark-util-decode-string "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + unist-util-stringify-position "^3.0.0" + uvu "^0.5.0" + +mdast-util-to-hast@^12.1.0: + version "12.1.1" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-12.1.1.tgz#89a2bb405eaf3b05eb8bf45157678f35eef5dbca" + integrity sha512-qE09zD6ylVP14jV4mjLIhDBOrpFdShHZcEsYvvKGABlr9mGbV7mTlRWdoFxL/EYSTNDiC9GZXy7y8Shgb9Dtzw== + dependencies: + "@types/hast" "^2.0.0" + "@types/mdast" "^3.0.0" + "@types/mdurl" "^1.0.0" + mdast-util-definitions "^5.0.0" + mdurl "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + unist-builder "^3.0.0" + unist-util-generated "^2.0.0" + unist-util-position "^4.0.0" + unist-util-visit "^4.0.0" + +mdast-util-to-string@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" + integrity sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA== + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -8587,6 +8730,11 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdurl@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + media-type@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/media-type/-/media-type-0.3.1.tgz#5d569cdd0c52d9c41c7c6451973edd267fb21bcb" @@ -8654,6 +8802,201 @@ methods@^1.1.2, methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= +micromark-core-commonmark@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz#edff4c72e5993d93724a3c206970f5a15b0585ad" + integrity sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-factory-destination "^1.0.0" + micromark-factory-label "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-factory-title "^1.0.0" + micromark-factory-whitespace "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-chunked "^1.0.0" + micromark-util-classify-character "^1.0.0" + micromark-util-html-tag-name "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-subtokenize "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.1" + uvu "^0.5.0" + +micromark-factory-destination@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz#fef1cb59ad4997c496f887b6977aa3034a5a277e" + integrity sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-factory-label@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz#6be2551fa8d13542fcbbac478258fb7a20047137" + integrity sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-factory-space@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz#cebff49968f2b9616c0fcb239e96685cb9497633" + integrity sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-factory-title@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz#7e09287c3748ff1693930f176e1c4a328382494f" + integrity sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A== + dependencies: + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-factory-whitespace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz#e991e043ad376c1ba52f4e49858ce0794678621c" + integrity sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A== + dependencies: + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-character@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-1.1.0.tgz#d97c54d5742a0d9611a68ca0cd4124331f264d86" + integrity sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-chunked@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz#5b40d83f3d53b84c4c6bce30ed4257e9a4c79d06" + integrity sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-classify-character@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz#cbd7b447cb79ee6997dd274a46fc4eb806460a20" + integrity sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-combine-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz#91418e1e74fb893e3628b8d496085639124ff3d5" + integrity sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-decode-numeric-character-reference@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz#dcc85f13b5bd93ff8d2868c3dba28039d490b946" + integrity sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-decode-string@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz#942252ab7a76dec2dbf089cc32505ee2bc3acf02" + integrity sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-decode-numeric-character-reference "^1.0.0" + micromark-util-symbol "^1.0.0" + +micromark-util-encode@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz#2c1c22d3800870ad770ece5686ebca5920353383" + integrity sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA== + +micromark-util-html-tag-name@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.0.0.tgz#75737e92fef50af0c6212bd309bc5cb8dbd489ed" + integrity sha512-NenEKIshW2ZI/ERv9HtFNsrn3llSPZtY337LID/24WeLqMzeZhBEE6BQ0vS2ZBjshm5n40chKtJ3qjAbVV8S0g== + +micromark-util-normalize-identifier@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz#4a3539cb8db954bbec5203952bfe8cedadae7828" + integrity sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-resolve-all@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz#a7c363f49a0162e931960c44f3127ab58f031d88" + integrity sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw== + dependencies: + micromark-util-types "^1.0.0" + +micromark-util-sanitize-uri@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz#27dc875397cd15102274c6c6da5585d34d4f12b2" + integrity sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-encode "^1.0.0" + micromark-util-symbol "^1.0.0" + +micromark-util-subtokenize@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz#ff6f1af6ac836f8bfdbf9b02f40431760ad89105" + integrity sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-util-symbol@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz#b90344db62042ce454f351cf0bebcc0a6da4920e" + integrity sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ== + +micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" + integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== + +micromark@^3.0.0: + version "3.0.10" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.0.10.tgz#1eac156f0399d42736458a14b0ca2d86190b457c" + integrity sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg== + dependencies: + "@types/debug" "^4.0.0" + debug "^4.0.0" + decode-named-character-reference "^1.0.0" + micromark-core-commonmark "^1.0.1" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-chunked "^1.0.0" + micromark-util-combine-extensions "^1.0.0" + micromark-util-decode-numeric-character-reference "^1.0.0" + micromark-util-encode "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-subtokenize "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.1" + uvu "^0.5.0" + micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -8898,6 +9241,11 @@ mri@1.1.4: resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w== +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -9992,7 +10340,7 @@ prop-types@^15, prop-types@^15.6.2, prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -prop-types@^15.8.1: +prop-types@^15.0.0, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -10001,6 +10349,11 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +property-information@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.1.1.tgz#5ca85510a3019726cb9afed4197b7b8ac5926a22" + integrity sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w== + proxy-addr@~2.0.5: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -10216,6 +10569,32 @@ react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-is@^18.0.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" + integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== + +react-markdown@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.3.tgz#e8aba0d2f5a1b2124d476ee1fff9448a2f57e4b3" + integrity sha512-We36SfqaKoVNpN1QqsZwWSv/OZt5J15LNgTLWynwAN5b265hrQrsjMtlRNwUvS+YyR3yDM8HpTNc4pK9H/Gc0A== + dependencies: + "@types/hast" "^2.0.0" + "@types/prop-types" "^15.0.0" + "@types/unist" "^2.0.0" + comma-separated-tokens "^2.0.0" + hast-util-whitespace "^2.0.0" + prop-types "^15.0.0" + property-information "^6.0.0" + react-is "^18.0.0" + remark-parse "^10.0.0" + remark-rehype "^10.0.0" + space-separated-tokens "^2.0.0" + style-to-object "^0.3.0" + unified "^10.0.0" + unist-util-visit "^4.0.0" + vfile "^5.0.0" + react-popper@^2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.2.5.tgz#1214ef3cec86330a171671a4fbcbeeb65ee58e96" @@ -10519,6 +10898,25 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= +remark-parse@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.1.tgz#6f60ae53edbf0cf38ea223fe643db64d112e0775" + integrity sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-from-markdown "^1.0.0" + unified "^10.0.0" + +remark-rehype@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-10.1.0.tgz#32dc99d2034c27ecaf2e0150d22a6dcccd9a6279" + integrity sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw== + dependencies: + "@types/hast" "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-to-hast "^12.1.0" + unified "^10.0.0" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -10764,6 +11162,13 @@ rxjs@^6.6.0, rxjs@^6.6.3: dependencies: tslib "^1.9.0" +sade@^1.7.3: + version "1.8.1" + resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" + integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== + dependencies: + mri "^1.1.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -11217,6 +11622,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +space-separated-tokens@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz#43193cec4fb858a2ce934b7f98b7f2c18107098b" + integrity sha512-ekwEbFp5aqSPKaqeY1PGrlGQxPNaq+Cnx4+bE2D8sciBQrHpbwoBbawqTN2+6jPs9IdWxxiUcN0K2pkczD3zmw== + spawn-command@^0.0.2-1: version "0.0.2-1" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" @@ -11615,6 +12025,13 @@ style-loader@^3.2.1: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.2.1.tgz#63cb920ec145c8669e9a50e92961452a1ef5dcde" integrity sha512-1k9ZosJCRFaRbY6hH49JFlRB0fVSbmnyq1iTPjNxUmGVjBNEmwrrHPenhlp+Lgo51BojHSf6pl2FcqYaN3PfVg== +style-to-object@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== + dependencies: + inline-style-parser "0.1.1" + styled-jsx@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-4.0.1.tgz#ae3f716eacc0792f7050389de88add6d5245b9e9" @@ -12061,6 +12478,11 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= +trough@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" + integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g== + tsconfig-paths@^3.11.0: version "3.11.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" @@ -12261,6 +12683,19 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== +unified@^10.0.0: + version "10.1.2" + resolved "https://registry.yarnpkg.com/unified/-/unified-10.1.2.tgz#b1d64e55dafe1f0b98bb6c719881103ecf6c86df" + integrity sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q== + dependencies: + "@types/unist" "^2.0.0" + bail "^2.0.0" + extend "^3.0.0" + is-buffer "^2.0.0" + is-plain-obj "^4.0.0" + trough "^2.0.0" + vfile "^5.0.0" + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -12285,6 +12720,71 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" +unist-builder@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-3.0.0.tgz#728baca4767c0e784e1e64bb44b5a5a753021a04" + integrity sha512-GFxmfEAa0vi9i5sd0R2kcrI9ks0r82NasRq5QHh2ysGngrc6GiqD5CDf1FjPenY4vApmFASBIIlk/jj5J5YbmQ== + dependencies: + "@types/unist" "^2.0.0" + +unist-util-generated@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-2.0.0.tgz#86fafb77eb6ce9bfa6b663c3f5ad4f8e56a60113" + integrity sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw== + +unist-util-is@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.1.1.tgz#e8aece0b102fa9bc097b0fef8f870c496d4a6236" + integrity sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ== + +unist-util-position@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-4.0.3.tgz#5290547b014f6222dff95c48d5c3c13a88fadd07" + integrity sha512-p/5EMGIa1qwbXjA+QgcBXaPWjSnZfQ2Sc3yBEEfgPwsEmJd8Qh+DSk3LGnmOM4S1bY2C0AjmMnB8RuEYxpPwXQ== + dependencies: + "@types/unist" "^2.0.0" + +unist-util-stringify-position@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz#5c6aa07c90b1deffd9153be170dce628a869a447" + integrity sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg== + dependencies: + "@types/unist" "^2.0.0" + +unist-util-visit-parents@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz#e83559a4ad7e6048a46b1bdb22614f2f3f4724f2" + integrity sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^5.0.0" + +unist-util-visit-parents@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz#44bbc5d25f2411e7dfc5cecff12de43296aa8521" + integrity sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^5.0.0" + +unist-util-visit@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-3.1.0.tgz#9420d285e1aee938c7d9acbafc8e160186dbaf7b" + integrity sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^4.0.0" + +unist-util-visit@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.0.tgz#f41e407a9e94da31594e6b1c9811c51ab0b3d8f5" + integrity sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^5.0.0" + universalify@^0.1.0, universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -12483,6 +12983,16 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uvu@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.3.tgz#3d83c5bc1230f153451877bfc7f4aea2392219ae" + integrity sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw== + dependencies: + dequal "^2.0.0" + diff "^5.0.0" + kleur "^4.0.3" + sade "^1.7.3" + v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -12525,6 +13035,24 @@ verror@1.10.0, verror@^1.9.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vfile-message@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-3.1.2.tgz#a2908f64d9e557315ec9d7ea3a910f658ac05f7d" + integrity sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA== + dependencies: + "@types/unist" "^2.0.0" + unist-util-stringify-position "^3.0.0" + +vfile@^5.0.0: + version "5.3.2" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-5.3.2.tgz#b499fbc50197ea50ad3749e9b60beb16ca5b7c54" + integrity sha512-w0PLIugRY3Crkgw89TeMvHCzqCs/zpreR31hl4D92y6SOE07+bfJe+dK5Q2akwS+i/c801kzjoOr9gMcTe6IAA== + dependencies: + "@types/unist" "^2.0.0" + is-buffer "^2.0.0" + unist-util-stringify-position "^3.0.0" + vfile-message "^3.0.0" + vm-browserify@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" From b9382bd87b806390bbdaad1693a2ccf62f083566 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Tue, 24 May 2022 17:02:48 +0200 Subject: [PATCH 02/21] fix: line-clamp in safari --- .../components/AppDescription/AppDescription.module.css | 1 + .../pages/Apps/AppCards/AppCardItem/AppCardItem.module.css | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/components/AppDescription/AppDescription.module.css b/client/src/components/AppDescription/AppDescription.module.css index df6dbdda3..12a650671 100644 --- a/client/src/components/AppDescription/AppDescription.module.css +++ b/client/src/components/AppDescription/AppDescription.module.css @@ -1,6 +1,7 @@ .markdownDescription h1,h2,h3,h4,h5,h6 { font-size: 16px; + font-weight: 500; } .markdownDescription a{ diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css index 76d1f337b..4db5a57ab 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css @@ -60,4 +60,9 @@ -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; -} \ No newline at end of file +} + +/* This is needed for line-clamp to work in Safari */ +.summarise > p { + display: inline; +} From 313fc6ede1fe16524edcc107481062d6377ab5c6 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Tue, 24 May 2022 18:17:59 +0200 Subject: [PATCH 03/21] feat(editapp): add preview for markdown --- .../src/pages/UserAppEdit/DescriptionEdit.js | 93 +++++++++++++++++++ client/src/pages/UserAppEdit/UserAppEdit.js | 16 +--- 2 files changed, 95 insertions(+), 14 deletions(-) create mode 100644 client/src/pages/UserAppEdit/DescriptionEdit.js diff --git a/client/src/pages/UserAppEdit/DescriptionEdit.js b/client/src/pages/UserAppEdit/DescriptionEdit.js new file mode 100644 index 000000000..c71607f57 --- /dev/null +++ b/client/src/pages/UserAppEdit/DescriptionEdit.js @@ -0,0 +1,93 @@ +import { + Tab, + TabBar, + ReactFinalForm, + TextAreaFieldFF, + hasValue, + Divider, + Label, +} from '@dhis2/ui' +import PropTypes from 'prop-types' +import { useState } from 'react' +import { useField } from 'react-final-form' +import AppDescription from '../../components/AppDescription/AppDescription' +import styles from './UserAppEdit.module.css' + +const tabs = { + WRITE: 'WRITE', + PREVIEW: 'PREVIEW', +} + +const DescriptionEdit = ({ description }) => { + const [selectedTab, setSelectedTab] = useState(tabs.WRITE) + + const handleSelectTab = (tab, _, event) => { + // stops submission of form + event.preventDefault() + setSelectedTab(tab) + } + + return ( +
+ + + + Write + + + Preview + + + {selectedTab === tabs.WRITE && ( + + )} + {selectedTab === tabs.PREVIEW && } +
+ ) +} + +DescriptionEdit.propTypes = { + description: PropTypes.string, +} + +const WriteContent = ({ description }) => { + return ( + + ) +} + +WriteContent.propTypes = { + description: PropTypes.string, +} + +const PreviewContent = () => { + const { + input: { value }, + } = useField('description') + + return ( +
+ + +
+ ) +} + +export default DescriptionEdit diff --git a/client/src/pages/UserAppEdit/UserAppEdit.js b/client/src/pages/UserAppEdit/UserAppEdit.js index 5c8563574..98c37f85f 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.js +++ b/client/src/pages/UserAppEdit/UserAppEdit.js @@ -6,14 +6,13 @@ import { Button, ReactFinalForm, InputFieldFF, - TextAreaFieldFF, SwitchFieldFF, - hasValue, url, } from '@dhis2/ui' import PropTypes from 'prop-types' import { useSelector } from 'react-redux' import { useHistory } from 'react-router-dom' +import DescriptionEdit from './DescriptionEdit' import styles from './UserAppEdit.module.css' import { useQueryV1 } from 'src/api' import * as api from 'src/api' @@ -83,18 +82,7 @@ const UserAppEdit = ({ match }) => { className={styles.field} validate={nameLengthValidator} /> - + Date: Tue, 24 May 2022 18:20:34 +0200 Subject: [PATCH 04/21] feat(appupload): add markdown-preview for description --- client/src/pages/UserAppUpload/UserAppUpload.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/client/src/pages/UserAppUpload/UserAppUpload.js b/client/src/pages/UserAppUpload/UserAppUpload.js index 740e1bb74..1c251dcb9 100644 --- a/client/src/pages/UserAppUpload/UserAppUpload.js +++ b/client/src/pages/UserAppUpload/UserAppUpload.js @@ -6,7 +6,6 @@ import { NoticeBox, ReactFinalForm, InputFieldFF, - TextAreaFieldFF, SingleSelectFieldFF, FileInputFieldFF, composeValidators, @@ -15,6 +14,7 @@ import { import PropTypes from 'prop-types' import { useMemo } from 'react' import { Link, useHistory } from 'react-router-dom' +import DescriptionEdit from '../UserAppEdit/DescriptionEdit' import CreateOrganisationModal from './CreateOrganisationModal/CreateOrganisationModal' import styles from './UserAppUpload.module.css' import config from 'config' @@ -32,7 +32,7 @@ const { defaultAppType, appTypeToDisplayName, defaultAppChannel, - // appChannelToDisplayName, + // appChannelToDisplayName, dhisVersions, } = config.ui const oldestSupportedDhisVersion = dhisVersions[2] @@ -57,7 +57,6 @@ const appTypeOptions = Object.entries(appTypeToDisplayName).map( }) */ - const requestOpts = { useAuth: true, } @@ -224,15 +223,7 @@ const UserAppUpload = ({ user }) => { className={styles.field} validate={nameLengthValidator} /> - + Date: Wed, 25 May 2022 18:18:33 +0200 Subject: [PATCH 05/21] fix: add note about markdown support --- .../AppDescription/AppDescription.module.css | 13 +++-- .../src/pages/UserAppEdit/DescriptionEdit.js | 44 ++++++++++----- .../pages/UserAppEdit/UserAppEdit.module.css | 56 ++++++++++++++++++- 3 files changed, 95 insertions(+), 18 deletions(-) diff --git a/client/src/components/AppDescription/AppDescription.module.css b/client/src/components/AppDescription/AppDescription.module.css index 12a650671..a7ae1850e 100644 --- a/client/src/components/AppDescription/AppDescription.module.css +++ b/client/src/components/AppDescription/AppDescription.module.css @@ -1,14 +1,19 @@ - -.markdownDescription h1,h2,h3,h4,h5,h6 { +.markdownDescription h1, +h2, +h3, +h4, +h5, +h6 { font-size: 16px; font-weight: 500; } -.markdownDescription a{ +.markdownDescription a { color: var(--colors-blue600); } -.markdownDescription a:hover { +.markdownDescription a:hover, +.markdownDescription a:focus { color: var(--colors-blue700); text-decoration: underline; } diff --git a/client/src/pages/UserAppEdit/DescriptionEdit.js b/client/src/pages/UserAppEdit/DescriptionEdit.js index c71607f57..e809fa67e 100644 --- a/client/src/pages/UserAppEdit/DescriptionEdit.js +++ b/client/src/pages/UserAppEdit/DescriptionEdit.js @@ -6,12 +6,14 @@ import { hasValue, Divider, Label, + Help, } from '@dhis2/ui' import PropTypes from 'prop-types' import { useState } from 'react' import { useField } from 'react-final-form' import AppDescription from '../../components/AppDescription/AppDescription' import styles from './UserAppEdit.module.css' +import MarkdownIcon from 'assets/icons/markdown_icon.svg' const tabs = { WRITE: 'WRITE', @@ -28,7 +30,7 @@ const DescriptionEdit = ({ description }) => { } return ( -
+
{ )} {selectedTab === tabs.PREVIEW && } + + A good app description helps users of the App Hub quickly + understand what the purpose of an app is and any requirements to + using it. +
) } @@ -59,17 +66,28 @@ DescriptionEdit.propTypes = { const WriteContent = ({ description }) => { return ( - +
+ + +
) } @@ -83,7 +101,7 @@ const PreviewContent = () => { } = useField('description') return ( -
+
diff --git a/client/src/pages/UserAppEdit/UserAppEdit.module.css b/client/src/pages/UserAppEdit/UserAppEdit.module.css index 0a172aabd..e59ab1c64 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.module.css +++ b/client/src/pages/UserAppEdit/UserAppEdit.module.css @@ -25,7 +25,8 @@ text-decoration: underline; } -.guidelinesLink:hover, .guidelinesLink:focus { +.guidelinesLink:hover, +.guidelinesLink:focus { color: var(--colors-grey900); } @@ -33,3 +34,56 @@ margin-bottom: var(--spacers-dp24); max-width: 480px; } + +.descriptionContainer { + margin-bottom: var(--spacers-dp24); +} + +.writeContent { + max-width: 480px; + border: 1px solid var(--colors-grey500); + border-radius: 3px; + background-color: var(--colors-grey100); +} + +.writeContent :global(textarea) { + border: 0 !important; + border-bottom: 1px dashed var(--colors-grey600) !important; +} + +/* + TODO: Can remove when UI-library is updated + Fix for status-icon margin + This is fixed in latest UI + https://github.com/dhis2/ui/commit/3f23cc541e52ed02e4846dadb7a8e54baa92aef6 */ +.writeContent :global(.status-icon) { + display: none; +} + +.previewContent { + max-width: 550px; +} + +.markdownSupported { + font-size: 12px; + padding: 4px 8px; + background-color: var(--colors-grey100); + color: var(--colors-grey700); + border-top: 1px dashed var(--colors-grey100); + display: flex; + justify-content: space-between; + align-items: center; +} + +.markdownLink { + fill: var(--colors-grey700); +} + +.markdownLink:hover, +.markdownLink:focus { + fill: var(--colors-grey900); +} + +.helpText { + max-width: 480px; +} From 0b7758f68adb5e6ffd348a65c29940c08961266e Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Wed, 25 May 2022 19:19:15 +0200 Subject: [PATCH 06/21] fix(appdescription): css and style cleanup --- .../src/pages/UserAppEdit/UserAppEdit.module.css | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/client/src/pages/UserAppEdit/UserAppEdit.module.css b/client/src/pages/UserAppEdit/UserAppEdit.module.css index e59ab1c64..d2a4b9ecf 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.module.css +++ b/client/src/pages/UserAppEdit/UserAppEdit.module.css @@ -36,11 +36,12 @@ } .descriptionContainer { + max-width: 480px; margin-bottom: var(--spacers-dp24); } .writeContent { - max-width: 480px; + margin-top: 8px; border: 1px solid var(--colors-grey500); border-radius: 3px; background-color: var(--colors-grey100); @@ -49,6 +50,8 @@ .writeContent :global(textarea) { border: 0 !important; border-bottom: 1px dashed var(--colors-grey600) !important; + border-bottom-left-radius: 0 !important; + box-shadow: none !important; } /* @@ -60,10 +63,6 @@ display: none; } -.previewContent { - max-width: 550px; -} - .markdownSupported { font-size: 12px; padding: 4px 8px; @@ -73,6 +72,7 @@ display: flex; justify-content: space-between; align-items: center; + border-radius: 3px; } .markdownLink { @@ -83,7 +83,3 @@ .markdownLink:focus { fill: var(--colors-grey900); } - -.helpText { - max-width: 480px; -} From b81cc1c11c1e6b09eb5e6f5418c36842af8cd883 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Mon, 30 May 2022 01:10:19 +0200 Subject: [PATCH 07/21] refactor: move MarkDownEditor to own component --- .../MarkdownEditor/MarkdownEditor.js | 27 ++++++++++++ .../MarkdownEditor/MarkdownEditor.module.css | 43 +++++++++++++++++++ .../src/pages/UserAppEdit/DescriptionEdit.js | 32 +++----------- .../pages/UserAppEdit/UserAppEdit.module.css | 3 -- 4 files changed, 75 insertions(+), 30 deletions(-) create mode 100644 client/src/components/MarkdownEditor/MarkdownEditor.js create mode 100644 client/src/components/MarkdownEditor/MarkdownEditor.module.css diff --git a/client/src/components/MarkdownEditor/MarkdownEditor.js b/client/src/components/MarkdownEditor/MarkdownEditor.js new file mode 100644 index 000000000..c641b5124 --- /dev/null +++ b/client/src/components/MarkdownEditor/MarkdownEditor.js @@ -0,0 +1,27 @@ +import { ReactFinalForm, TextAreaFieldFF } from '@dhis2/ui' +import styles from './MarkdownEditor.module.css' +import MarkdownIcon from 'assets/icons/markdown_icon.svg' + +const MarkdownEditor = ({ ...fieldProps }) => { + return ( +
+ + +
+ ) +} + +export default MarkdownEditor diff --git a/client/src/components/MarkdownEditor/MarkdownEditor.module.css b/client/src/components/MarkdownEditor/MarkdownEditor.module.css new file mode 100644 index 000000000..adf5475a8 --- /dev/null +++ b/client/src/components/MarkdownEditor/MarkdownEditor.module.css @@ -0,0 +1,43 @@ + +.markdownFieldWrapper { + border: 1px solid var(--colors-grey500); + border-radius: 3px; + background-color: var(--colors-grey100); +} + +.markdownFieldWrapper :global(textarea) { + border: 0 !important; + border-bottom: 1px dashed var(--colors-grey600) !important; + border-bottom-left-radius: 0 !important; + box-shadow: none !important; +} + +/* + TODO: Can remove when UI-library is updated + Fix for status-icon margin + This is fixed in latest UI + https://github.com/dhis2/ui/commit/3f23cc541e52ed02e4846dadb7a8e54baa92aef6 */ +.markdownFieldWrapper :global(.status-icon) { + display: none; +} + +.markdownSupportedText { + font-size: 12px; + padding: 4px 8px; + background-color: var(--colors-grey100); + color: var(--colors-grey700); + border-top: 1px dashed var(--colors-grey100); + display: flex; + justify-content: space-between; + align-items: center; + border-radius: 3px; +} + +.markdownLink { + fill: var(--colors-grey700); +} + +.markdownLink:hover, +.markdownLink:focus { + fill: var(--colors-grey900); +} diff --git a/client/src/pages/UserAppEdit/DescriptionEdit.js b/client/src/pages/UserAppEdit/DescriptionEdit.js index e809fa67e..9d908c5aa 100644 --- a/client/src/pages/UserAppEdit/DescriptionEdit.js +++ b/client/src/pages/UserAppEdit/DescriptionEdit.js @@ -1,19 +1,10 @@ -import { - Tab, - TabBar, - ReactFinalForm, - TextAreaFieldFF, - hasValue, - Divider, - Label, - Help, -} from '@dhis2/ui' +import { Tab, TabBar, hasValue, Divider, Label, Help } from '@dhis2/ui' import PropTypes from 'prop-types' import { useState } from 'react' import { useField } from 'react-final-form' import AppDescription from '../../components/AppDescription/AppDescription' import styles from './UserAppEdit.module.css' -import MarkdownIcon from 'assets/icons/markdown_icon.svg' +import MarkdownEditor from '../../components/MarkdownEditor/MarkdownEditor' const tabs = { WRITE: 'WRITE', @@ -67,26 +58,13 @@ DescriptionEdit.propTypes = { const WriteContent = ({ description }) => { return (
- -
) } diff --git a/client/src/pages/UserAppEdit/UserAppEdit.module.css b/client/src/pages/UserAppEdit/UserAppEdit.module.css index d2a4b9ecf..d38351fb1 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.module.css +++ b/client/src/pages/UserAppEdit/UserAppEdit.module.css @@ -42,9 +42,6 @@ .writeContent { margin-top: 8px; - border: 1px solid var(--colors-grey500); - border-radius: 3px; - background-color: var(--colors-grey100); } .writeContent :global(textarea) { From faccaebe2478cdc1f386dfdb03c571528c58b497 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Mon, 30 May 2022 01:13:12 +0200 Subject: [PATCH 08/21] refactor: descriptionEdit to editor --- .../src/pages/UserAppEdit/DescriptionEdit.js | 89 ------------------- client/src/pages/UserAppEdit/UserAppEdit.js | 6 +- .../src/pages/UserAppUpload/UserAppUpload.js | 8 +- 3 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 client/src/pages/UserAppEdit/DescriptionEdit.js diff --git a/client/src/pages/UserAppEdit/DescriptionEdit.js b/client/src/pages/UserAppEdit/DescriptionEdit.js deleted file mode 100644 index 9d908c5aa..000000000 --- a/client/src/pages/UserAppEdit/DescriptionEdit.js +++ /dev/null @@ -1,89 +0,0 @@ -import { Tab, TabBar, hasValue, Divider, Label, Help } from '@dhis2/ui' -import PropTypes from 'prop-types' -import { useState } from 'react' -import { useField } from 'react-final-form' -import AppDescription from '../../components/AppDescription/AppDescription' -import styles from './UserAppEdit.module.css' -import MarkdownEditor from '../../components/MarkdownEditor/MarkdownEditor' - -const tabs = { - WRITE: 'WRITE', - PREVIEW: 'PREVIEW', -} - -const DescriptionEdit = ({ description }) => { - const [selectedTab, setSelectedTab] = useState(tabs.WRITE) - - const handleSelectTab = (tab, _, event) => { - // stops submission of form - event.preventDefault() - setSelectedTab(tab) - } - - return ( -
- - - - Write - - - Preview - - - {selectedTab === tabs.WRITE && ( - - )} - {selectedTab === tabs.PREVIEW && } - - A good app description helps users of the App Hub quickly - understand what the purpose of an app is and any requirements to - using it. - -
- ) -} - -DescriptionEdit.propTypes = { - description: PropTypes.string, -} - -const WriteContent = ({ description }) => { - return ( -
- -
- ) -} - -WriteContent.propTypes = { - description: PropTypes.string, -} - -const PreviewContent = () => { - const { - input: { value }, - } = useField('description') - - return ( -
- - -
- ) -} - -export default DescriptionEdit diff --git a/client/src/pages/UserAppEdit/UserAppEdit.js b/client/src/pages/UserAppEdit/UserAppEdit.js index 98c37f85f..494912516 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.js +++ b/client/src/pages/UserAppEdit/UserAppEdit.js @@ -12,7 +12,7 @@ import { import PropTypes from 'prop-types' import { useSelector } from 'react-redux' import { useHistory } from 'react-router-dom' -import DescriptionEdit from './DescriptionEdit' +import DescriptionEditor from './DescriptionEditor' import styles from './UserAppEdit.module.css' import { useQueryV1 } from 'src/api' import * as api from 'src/api' @@ -28,7 +28,7 @@ const UserAppEdit = ({ match }) => { const errorAlert = useErrorAlert() const isManager = useSelector(isManagerSelector) - const handleSubmit = async values => { + const handleSubmit = async (values) => { try { await api.updateApp(app.id, values) successAlert.show({ message: 'App updated successfully' }) @@ -82,7 +82,7 @@ const UserAppEdit = ({ match }) => { className={styles.field} validate={nameLengthValidator} /> - + ({ +const dhisVersionOptions = dhisVersions.map((v) => ({ label: v, value: v, })) @@ -119,7 +119,7 @@ const UserAppUpload = ({ user }) => { ) } - const organisationOptions = organisations.map(organisation => ({ + const organisationOptions = organisations.map((organisation) => ({ label: organisation.name, value: organisation.id, })) @@ -223,7 +223,7 @@ const UserAppUpload = ({ user }) => { className={styles.field} validate={nameLengthValidator} /> - + Date: Mon, 30 May 2022 01:17:05 +0200 Subject: [PATCH 09/21] refactor: summarize to summary --- .../pages/Apps/AppCards/AppCardItem/AppCardItem.js | 12 ++++++------ .../Apps/AppCards/AppCardItem/AppCardItem.module.css | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js index 4b52d01f9..a83962656 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.js @@ -7,7 +7,7 @@ import config from 'config' import AppIcon from 'src/components/AppIcon/AppIcon' const AppCardItem = ({ id, name, developer, type, description, images }) => { - const logo = images.find(elem => elem.logo) + const logo = images.find((elem) => elem.logo) return ( @@ -25,24 +25,24 @@ const AppCardItem = ({ id, name, developer, type, description, images }) => {

- +

{description} - +

) } -const Summarise = ({ children }) => { - return
{children}
+const Summary = ({ children }) => { + return
{children}
} -Summarise.propTypes = { +Summary.propTypes = { children: PropTypes.node, } diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css index 4db5a57ab..b93f018fd 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css @@ -55,7 +55,7 @@ width: 25px } -.summarise { +.summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; @@ -63,6 +63,6 @@ } /* This is needed for line-clamp to work in Safari */ -.summarise > p { +.summary > p { display: inline; } From fb10680bbbeb9df4aecf4807525ea6123424ea0a Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Mon, 30 May 2022 01:22:37 +0200 Subject: [PATCH 10/21] fix: update markdown-guide url --- client/src/components/MarkdownEditor/MarkdownEditor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/MarkdownEditor/MarkdownEditor.js b/client/src/components/MarkdownEditor/MarkdownEditor.js index c641b5124..21d942dcd 100644 --- a/client/src/components/MarkdownEditor/MarkdownEditor.js +++ b/client/src/components/MarkdownEditor/MarkdownEditor.js @@ -2,6 +2,8 @@ import { ReactFinalForm, TextAreaFieldFF } from '@dhis2/ui' import styles from './MarkdownEditor.module.css' import MarkdownIcon from 'assets/icons/markdown_icon.svg' +const MARKDOWN_GUIDE_URL = 'https://www.markdownguide.org/basic-syntax/' + const MarkdownEditor = ({ ...fieldProps }) => { return (
@@ -13,7 +15,7 @@ const MarkdownEditor = ({ ...fieldProps }) => {