From a09b48985c6b8f3249c07001d96eba98a892c51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 13 Dec 2024 10:11:01 +0100 Subject: [PATCH 1/8] feat: Add cozy-dataproxy-lib We need to update cozy-scripts to 8.4.0 to support the lib. --- package.json | 3 +- src/targets/browser/index.jsx | 1 + yarn.lock | 268 ++++++++++++++++++++++++++++++++-- 3 files changed, 259 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 784e972072..d8bb09dc4d 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "cozy-ci": "0.5.2", "cozy-client": "^51.6.1", "cozy-client-js": "0.20.0", + "cozy-dataproxy-lib": "^1.9.0", "cozy-device-helper": "^2.7.0", "cozy-devtools": "^1.2.1", "cozy-doctypes": "1.85.4", @@ -94,7 +95,7 @@ "cozy-logger": "1.9.1", "cozy-minilog": "3.3.1", "cozy-realtime": "4.6.0", - "cozy-scripts": "^8.3.0", + "cozy-scripts": "^8.4.0", "cozy-sharing": "^16.17.0", "cozy-stack-client": "^51.6.0", "cozy-ui": "^114.0.1", diff --git a/src/targets/browser/index.jsx b/src/targets/browser/index.jsx index 24c239eb6c..7d154fe1da 100644 --- a/src/targets/browser/index.jsx +++ b/src/targets/browser/index.jsx @@ -8,6 +8,7 @@ import 'cozy-ui/dist/cozy-ui.utils.min.css' import 'cozy-viewer/dist/stylesheet.css' import 'cozy-bar/dist/stylesheet.css' import 'cozy-sharing/dist/stylesheet.css' +import 'cozy-dataproxy-lib/dist/stylesheet.css' // Uncomment to activate why-did-you-render // https://github.com/welldone-software/why-did-you-render diff --git a/yarn.lock b/yarn.lock index 405ba415c4..936fcbccc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4044,6 +4044,13 @@ abbrev@^1.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abort-controller@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -5235,7 +5242,7 @@ buffer-from@1.1.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" integrity sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ== -buffer-from@^1.0.0: +buffer-from@1.1.2, buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== @@ -5696,6 +5703,11 @@ classnames@2.3.1, classnames@^2.2.5, classnames@^2.2.6: resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== +classnames@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.5.1.tgz#ba774c614be0f016da105c858e7159eae8e7687b" + integrity sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow== + classnames@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924" @@ -5888,6 +5900,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +comlink@4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/comlink/-/comlink-4.4.1.tgz#e568b8e86410b809e8600eb2cf40c189371ef981" + integrity sha512-+1dlx0aY5Jo1vHy/tSsIGpSkN4tS9rZSW8FIhG0JH/crs9wwweswIo/POr451r7bZww3hFbPAKnTpimzL/mm4Q== + commander@2.17.x: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" @@ -6242,6 +6259,31 @@ cozy-client@^45.14.1: sift "^6.0.0" url-search-params-polyfill "^8.0.0" +cozy-client@^50.4.0: + version "50.4.0" + resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-50.4.0.tgz#dc341e71b2acee90342cf86e17392e890e7e7093" + integrity sha512-DINi/YwDrzBkXzcm63hFj8Y09yzzLaRWhJqyCu1JT6bdIpV2jc9lJMJe1pcud8xfg29OzSQ5/8gDf5MaQLkzsQ== + dependencies: + "@cozy/minilog" "1.0.0" + "@types/jest" "^26.0.20" + "@types/lodash" "^4.14.170" + btoa "^1.2.1" + cozy-stack-client "^50.4.0" + date-fns "2.29.3" + json-stable-stringify "^1.0.1" + lodash "^4.17.13" + microee "^0.0.6" + node-fetch "^2.6.1" + node-polyglot "2.4.2" + open "7.4.2" + prop-types "^15.6.2" + react-redux "^7.2.0" + redux "3 || 4" + redux-thunk "^2.3.0" + server-destroy "^1.0.1" + sift "^6.0.0" + url-search-params-polyfill "^8.0.0" + cozy-client@^51.6.1: version "51.6.1" resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-51.6.1.tgz#55ba89c3ddedf47444ef2aa2799b5e6d12e04f76" @@ -6267,6 +6309,21 @@ cozy-client@^51.6.1: sift "^6.0.0" url-search-params-polyfill "^8.0.0" +cozy-dataproxy-lib@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/cozy-dataproxy-lib/-/cozy-dataproxy-lib-1.9.0.tgz#5e43d49f2ac86e5d6a96bb74260e2567392626eb" + integrity sha512-ij9a3x20THxCRjvqcG8yR3hJXZhidDWawaTsfQaCT/eQUS5vwGx4Ob2p6Fur4G8GqayMSmbMsrfkGXv4JlEb/g== + dependencies: + classnames "2.5.1" + comlink "4.4.1" + cozy-device-helper "^3.7.1" + cozy-pouch-link "^50.3.1" + flexsearch "0.7.43" + lodash "4.17.21" + mime-types "2.1.35" + react-type-animation "3.2.0" + rooks "7.14.1" + cozy-device-helper@^2.1.0, cozy-device-helper@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/cozy-device-helper/-/cozy-device-helper-2.7.0.tgz#573749997f18e5a1f11f720faec8c9bf2406beeb" @@ -6505,6 +6562,15 @@ cozy-minilog@^3.9.1: dependencies: microee "0.0.6" +cozy-pouch-link@^50.3.1: + version "50.4.0" + resolved "https://registry.yarnpkg.com/cozy-pouch-link/-/cozy-pouch-link-50.4.0.tgz#6cd18521a8652502783d35ec6735de40af47ce62" + integrity sha512-7CkyEpsjjxE/24oMsxOcrQT+FWi7LPK0kYKx/KoiD7VX1QxHcZSubjnPjREJJkECs1JwIiAH5z/h99qVO4hArQ== + dependencies: + cozy-client "^50.4.0" + pouchdb-browser "^7.2.2" + pouchdb-find "^7.2.2" + cozy-realtime@4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/cozy-realtime/-/cozy-realtime-4.6.0.tgz#2600d091bef95c197ec5ebe0308df34507c81516" @@ -6520,10 +6586,10 @@ cozy-release@1.10.0: dependencies: exec-sh "0.3.2" -cozy-scripts@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/cozy-scripts/-/cozy-scripts-8.3.0.tgz#dec3a5c9568a5e44e1baf6cd9983a7c55418ba95" - integrity sha512-UrzifMUyIleTs7M+H449uOm/3OA/7vqUVlpA6IYi+BftUG4WbOEmU3oG9dmxRK5kVK+VhJURBk+9LJ+C+84syg== +cozy-scripts@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/cozy-scripts/-/cozy-scripts-8.4.0.tgz#d1c5e531d3cf452e6fab896343d82a22452ece56" + integrity sha512-ol+UcsFW2fNixFGrVWTxCEOsLnmhqvTPggANvvkmLMqw4xMgpddiSetWVKdUrtnTnSqTzpL4My4V+BsQl73xuA== dependencies: "@babel/core" "7.10.0" "@babel/polyfill" "^7.10.4" @@ -6603,6 +6669,15 @@ cozy-stack-client@^45.13.0: mime "^2.4.0" qs "^6.7.0" +cozy-stack-client@^50.4.0: + version "50.4.0" + resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-50.4.0.tgz#3326a1299cacb06b95a484dc656cc301ce811ade" + integrity sha512-u8NXO6uUrcT0SggtOePpOXftGdwe1zCiOHQIzvUAeuZIt4mVruF1zYXaPz90/zI4pHzr8mHH2h6KXHgH1McjWA== + dependencies: + detect-node "^2.0.4" + mime "^2.4.0" + qs "^6.7.0" + cozy-stack-client@^51.6.0: version "51.6.0" resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-51.6.0.tgz#bd81605bdd1e68161d1143856f78bca969086575" @@ -8435,6 +8510,11 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -8743,6 +8823,13 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +fetch-cookie@0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.11.0.tgz#e046d2abadd0ded5804ce7e2cae06d4331c15407" + integrity sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA== + dependencies: + tough-cookie "^2.3.3 || ^3.0.1 || ^4.0.0" + fetch-cookie@0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.7.0.tgz#a6fc137ad8363aa89125864c6451b86ecb7de802" @@ -8979,6 +9066,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +flexsearch@0.7.43: + version "0.7.43" + resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.7.43.tgz#34f89b36278a466ce379c5bf6fb341965ed3f16c" + integrity sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg== + fluids@^0.1.6: version "0.1.10" resolved "https://registry.yarnpkg.com/fluids/-/fluids-0.1.10.tgz#0517e7a53dbce1db011dddec301b75178518ba0e" @@ -10066,6 +10158,11 @@ immediate@3.0.6, immediate@~3.0.5: resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= +immediate@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" + integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== + import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -12964,9 +13061,9 @@ msgpack5@^4.0.2: readable-stream "^2.3.6" safe-buffer "^5.1.2" -"mui-bottom-sheet@git+https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": +"mui-bottom-sheet@https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": version "1.0.8" - resolved "git+https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" + resolved "https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" dependencies: "@juggle/resize-observer" "^3.1.3" jest-environment-jsdom-sixteen "^1.0.3" @@ -14337,6 +14434,20 @@ pouchdb-abstract-mapreduce@7.0.0: pouchdb-md5 "7.0.0" pouchdb-utils "7.0.0" +pouchdb-abstract-mapreduce@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-7.3.1.tgz#96ff4a0f41cbe273f3f52fde003b719005a2093c" + integrity sha512-0zKXVFBvrfc1KnN0ggrB762JDmZnUpePHywo9Bq3Jy+L1FnoG7fXM5luFfvv5/T0gEw+ZTIwoocZECMnESBI9w== + dependencies: + pouchdb-binary-utils "7.3.1" + pouchdb-collate "7.3.1" + pouchdb-collections "7.3.1" + pouchdb-errors "7.3.1" + pouchdb-fetch "7.3.1" + pouchdb-mapreduce-utils "7.3.1" + pouchdb-md5 "7.3.1" + pouchdb-utils "7.3.1" + pouchdb-binary-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.0.0.tgz#cb71a288b09572a231f6bab1b4aed201c4d219a7" @@ -14344,6 +14455,13 @@ pouchdb-binary-utils@7.0.0: dependencies: buffer-from "1.1.0" +pouchdb-binary-utils@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.3.1.tgz#eea22d9a5f880fcd95062476f4f5484cdf61496f" + integrity sha512-crZJNfAEOnUoRk977Qtmk4cxEv6sNKllQ6vDDKgQrQLFjMUXma35EHzNyIJr1s76J77Q4sqKQAmxz9Y40yHGtw== + dependencies: + buffer-from "1.1.2" + pouchdb-browser@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-browser/-/pouchdb-browser-7.0.0.tgz#d493fd738f21f7c91f17bbb7ee7ad97c2072e546" @@ -14356,16 +14474,38 @@ pouchdb-browser@7.0.0: uuid "3.2.1" vuvuzela "1.0.3" +pouchdb-browser@^7.2.2: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-browser/-/pouchdb-browser-7.3.1.tgz#6b2f9f35f42d2c83fc205de5e0403c0aae7046aa" + integrity sha512-qZ8awkXl/woBHvEVqNHjDtwPDA7A9v4ItHtX1y1eVpKel4mlYqnIJ8K6pRcFUZmVaHinJW8K3uS32eHC1q0yOA== + dependencies: + argsarray "0.0.1" + immediate "3.3.0" + inherits "2.0.4" + spark-md5 "3.0.2" + uuid "8.3.2" + vuvuzela "1.0.3" + pouchdb-collate@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-7.0.0.tgz#4f9a0a03c236f1677a971c400b79b7baf6379a4d" integrity sha512-0O67rnNGVD9OUbDx+6DLPcE3zz7w6gieNCvrbvaI5ibIXuLpyMyLjD6OdRe/19LbstEfZaOp+SYUhQs+TP8Plg== +pouchdb-collate@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-7.3.1.tgz#19d7b87dd173d1c765da8cc9987c5aa9eb24f11f" + integrity sha512-o4gyGqDMLMSNzf6EDTr3eHaH/JRMoqRhdc+eV+oA8u00nTBtr9wD+jypVe2LbgKLJ4NWqx2qVkXiTiQdUFtsLQ== + pouchdb-collections@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-7.0.0.tgz#fd1f632337dc6301b0ff8649732ca79204e41780" integrity sha512-DaoUr/vU24Q3gM6ghj0va9j/oBanPwkbhkvnqSyC3Dm5dgf5pculNxueLF9PKMo3ycApoWzHMh6N2N8KJbDU2Q== +pouchdb-collections@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-7.3.1.tgz#4f1819cf4dd6936a422c29f7fa26a9b5dca428f5" + integrity sha512-yUyDqR+OJmtwgExOSJegpBJXDLAEC84TWnbAYycyh+DZoA51Yw0+XVQF5Vh8Ii90/Ut2xo88fmrmp0t6kqom8w== + pouchdb-errors@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-7.0.0.tgz#4e2a5a8b82af20cbe5f9970ca90b7ec74563caa0" @@ -14373,6 +14513,13 @@ pouchdb-errors@7.0.0: dependencies: inherits "2.0.3" +pouchdb-errors@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-7.3.1.tgz#78be36721e2edc446fac158a236a9218c7bcdb14" + integrity sha512-Zktz4gnXEUcZcty8FmyvtYUYsHskoST05m6H5/E2gg/0mCfEXq/XeyyLkZHaZmqD0ZPS9yNmASB1VaFWEKEaDw== + dependencies: + inherits "2.0.4" + pouchdb-fetch@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-fetch/-/pouchdb-fetch-7.0.0.tgz#6b56cc49863837f8d5e38b0956ace03f1fcaf8e0" @@ -14381,6 +14528,15 @@ pouchdb-fetch@7.0.0: fetch-cookie "0.7.0" node-fetch "^2.0.0" +pouchdb-fetch@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-fetch/-/pouchdb-fetch-7.3.1.tgz#d54b1807be0f0a5d4b6d06e416c7d54952bbc348" + integrity sha512-205xAtvdHRPQ4fp1h9+RmT9oQabo9gafuPmWsS9aEl3ER54WbY8Vaj1JHZGbU4KtMTYvW7H5088zLS7Nrusuag== + dependencies: + abort-controller "3.0.0" + fetch-cookie "0.11.0" + node-fetch "2.6.7" + pouchdb-find@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-7.0.0.tgz#f390c3f7a9455e700eb178eb89b235aaf7dc3beb" @@ -14394,6 +14550,19 @@ pouchdb-find@7.0.0: pouchdb-selector-core "7.0.0" pouchdb-utils "7.0.0" +pouchdb-find@^7.2.2: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-7.3.1.tgz#07a633d5ee2bd731dae9f991281cd25212088d29" + integrity sha512-AeqUfAVY1c7IFaY36BRT0vIz9r4VTKq/YOWTmiqndOZUQ/pDGxyO2fNFal6NN3PyYww0JijlD377cPvhnrhJVA== + dependencies: + pouchdb-abstract-mapreduce "7.3.1" + pouchdb-collate "7.3.1" + pouchdb-errors "7.3.1" + pouchdb-fetch "7.3.1" + pouchdb-md5 "7.3.1" + pouchdb-selector-core "7.3.1" + pouchdb-utils "7.3.1" + pouchdb-mapreduce-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-7.0.0.tgz#ff342e9d515d4c9cf0b19ad85c78f10f2568493b" @@ -14404,6 +14573,16 @@ pouchdb-mapreduce-utils@7.0.0: pouchdb-collections "7.0.0" pouchdb-utils "7.0.0" +pouchdb-mapreduce-utils@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-7.3.1.tgz#f0ac2c8400fbedb705e9226082453ac7d3f2a066" + integrity sha512-oUMcq82+4pTGQ6dtrhgORHOVHZSr6w/5tFIUGlv7RABIDvJarL4snMawADjlpiEwPdiQ/ESG8Fqt8cxqvqsIgg== + dependencies: + argsarray "0.0.1" + inherits "2.0.4" + pouchdb-collections "7.3.1" + pouchdb-utils "7.3.1" + pouchdb-md5@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-7.0.0.tgz#935dc6bb507a5f3978fb653ca5790331bae67c96" @@ -14412,6 +14591,14 @@ pouchdb-md5@7.0.0: pouchdb-binary-utils "7.0.0" spark-md5 "3.0.0" +pouchdb-md5@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-7.3.1.tgz#70fae44f9d27eb4c6a8e7106156b4593d31c1762" + integrity sha512-aDV8ui/mprnL3xmt0gT/81DFtTtJiKyn+OxIAbwKPMfz/rDFdPYvF0BmDC9QxMMzGfkV+JJUjU6at0PPs2mRLg== + dependencies: + pouchdb-binary-utils "7.3.1" + spark-md5 "3.0.2" + pouchdb-selector-core@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-7.0.0.tgz#824bd0980bd9778b3ddef869306a6cdb928df703" @@ -14420,6 +14607,14 @@ pouchdb-selector-core@7.0.0: pouchdb-collate "7.0.0" pouchdb-utils "7.0.0" +pouchdb-selector-core@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-7.3.1.tgz#08245662de3d61f16ab8dae2b56ef622935b3fb3" + integrity sha512-HBX+nNGXcaL9z0uNpwSMRq2GNZd3EZXW+fe9rJHS0hvJohjZL7aRJLoaXfEdHPRTNW+CpjM3Rny60eGekQdI/w== + dependencies: + pouchdb-collate "7.3.1" + pouchdb-utils "7.3.1" + pouchdb-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.0.0.tgz#48bfced6665b8f5a2b2d2317e2aa57635ed1e88e" @@ -14434,6 +14629,20 @@ pouchdb-utils@7.0.0: pouchdb-md5 "7.0.0" uuid "3.2.1" +pouchdb-utils@7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.3.1.tgz#d25f0a034427f388ba5ae37d9ae3fbed210e8720" + integrity sha512-R3hHBo1zTdTu/NFs3iqkcaQAPwhIH0gMIdfVKd5lbDYlmP26rCG5pdS+v7NuoSSFLJ4xxnaGV+Gjf4duYsJ8wQ== + dependencies: + argsarray "0.0.1" + clone-buffer "1.0.0" + immediate "3.3.0" + inherits "2.0.4" + pouchdb-collections "7.3.1" + pouchdb-errors "7.3.1" + pouchdb-md5 "7.3.1" + uuid "8.3.2" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -15156,6 +15365,11 @@ react-transition-group@^4.3.0, react-transition-group@^4.4.0: loose-envify "^1.4.0" prop-types "^15.6.2" +react-type-animation@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/react-type-animation/-/react-type-animation-3.2.0.tgz#6863d5d60e3beb237f2bd690cceb585402c47e6a" + integrity sha512-WXTe0i3rRNKjmggPvT5ntye1QBt0ATGbijeW6V3cQe2W0jaMABXXlPPEdtofnS9tM7wSRHchEvI9SUw+0kUohw== + react-use-gesture@^7.0.8: version "7.0.16" resolved "https://registry.yarnpkg.com/react-use-gesture/-/react-use-gesture-7.0.16.tgz#501985261ef9c815a377b6ff9be6df5a85fbb54f" @@ -15781,6 +15995,16 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rooks@7.14.1: + version "7.14.1" + resolved "https://registry.yarnpkg.com/rooks/-/rooks-7.14.1.tgz#f3660752c299da02eb6cc733c55f8270c3376a87" + integrity sha512-oPuLNGm3OaFm3WfZHzmDvJvRit8QrXGm9/Kn49Bz8lJUjkThSBtERWzuQ9wb5DveqrpUZvmNyBXjBE0KWVt13w== + dependencies: + fast-deep-equal "^3.1.3" + lodash.debounce "^4.0.8" + raf "^3.4.1" + use-sync-external-store "^1.2.0" + rooks@^5.11.2: version "5.11.2" resolved "https://registry.yarnpkg.com/rooks/-/rooks-5.11.2.tgz#f7ba3a758c512c7cc807af38615f3052439578b8" @@ -16389,6 +16613,11 @@ spark-md5@3.0.0: resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef" integrity sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8= +spark-md5@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.2.tgz#7952c4a30784347abcee73268e473b9c0167e3fc" + integrity sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw== + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -17316,6 +17545,16 @@ tough-cookie@^2.3.1, tough-cookie@^2.3.3, tough-cookie@^2.5.0, tough-cookie@~2.5 psl "^1.1.28" punycode "^2.1.1" +"tough-cookie@^2.3.3 || ^3.0.1 || ^4.0.0": + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" @@ -17858,6 +18097,11 @@ use-sidecar@^1.0.1: detect-node-es "^1.0.0" tslib "^1.9.3" +use-sync-external-store@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz#adbc795d8eeb47029963016cefdf89dc799fcebc" + integrity sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw== + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -17944,16 +18188,16 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== +uuid@8.3.2, uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uuid@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" From 17ee2be94e6458760c7ae2ea4138b531b92c7710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 13 Dec 2024 09:35:54 +0100 Subject: [PATCH 2/8] feat: Use search from dataproxy --- src/components/App/App.jsx | 17 ++++++++++------- src/modules/search/components/AppBarSearch.jsx | 15 ++++++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/components/App/App.jsx b/src/components/App/App.jsx index f70c319c09..051baff803 100644 --- a/src/components/App/App.jsx +++ b/src/components/App/App.jsx @@ -3,6 +3,7 @@ import React from 'react' import { Provider } from 'react-redux' import { BarProvider } from 'cozy-bar' +import { DataProxyProvider } from 'cozy-dataproxy-lib' import { WebviewIntentProvider } from 'cozy-intent' import PushBannerProvider from 'components/PushBanner/PushBannerProvider' @@ -25,13 +26,15 @@ const App = ({ isPublic, store, client, lang, polyglot, children }) => { - - - - {children} - - - + + + + + {children} + + + + diff --git a/src/modules/search/components/AppBarSearch.jsx b/src/modules/search/components/AppBarSearch.jsx index ebd39def69..af7e8fdac1 100644 --- a/src/modules/search/components/AppBarSearch.jsx +++ b/src/modules/search/components/AppBarSearch.jsx @@ -1,16 +1,21 @@ import React from 'react' import { BarSearch } from 'cozy-bar' +import { AssistantDesktop } from 'cozy-dataproxy-lib' import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -import BarSearchAutosuggest from 'modules/search/components/BarSearchAutosuggest' const AppBarSearch = () => { - const { t } = useI18n() const { isMobile } = useBreakpoints() - return {!isMobile && } + return ( + + {!isMobile && ( + + )} + + ) } export default AppBarSearch From 0b35de0cf9d0fbd1216e1bb8422502ac4530efb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 13 Dec 2024 09:26:34 +0100 Subject: [PATCH 3/8] feat: Add View for mobile search and assistant We can just replace the previous search view by the new one easily because both are full page modal. --- src/modules/navigation/AppRoute.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/navigation/AppRoute.jsx b/src/modules/navigation/AppRoute.jsx index 4629f06fe0..482e5bf2e1 100644 --- a/src/modules/navigation/AppRoute.jsx +++ b/src/modules/navigation/AppRoute.jsx @@ -1,6 +1,8 @@ import React from 'react' import { Route, useParams, Navigate } from 'react-router-dom' +import { RealTimeQueries } from 'cozy-client' +import { SearchDialog, AssistantDialog } from 'cozy-dataproxy-lib' import flag from 'cozy-flags' import ExternalRedirect from './ExternalRedirect' @@ -12,7 +14,6 @@ import OnlyOfficeCreateView from '../views/OnlyOffice/Create' import OnlyOfficePaywallView from '../views/OnlyOffice/OnlyOfficePaywallView' import RecentView from '../views/Recent' import FilesViewerRecent from '../views/Recent/FilesViewerRecent' -import SearchView from '../views/Search/SearchView' import SharingsView from '../views/Sharings' import SharingsFilesViewer from '../views/Sharings/FilesViewerSharings' import SharingsFolderView from '../views/Sharings/SharingsFolderView' @@ -152,7 +153,16 @@ const AppRoute = () => ( /> } /> - } /> + } /> + + + + + } + /> }> } /> From 73106a541791a1f7d483118ce745eeff82a937a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 13 Dec 2024 09:25:16 +0100 Subject: [PATCH 4/8] feat: Add permissions for cozy assistant --- manifest.webapp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manifest.webapp b/manifest.webapp index de20756b20..c6f686f63d 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -178,6 +178,16 @@ "type": "eu.mycozy.dacc_v2", "verbs": ["POST"], "description": "Remote-doctype required to send anonymized measures to the DACC shared among mycozy.eu's Cozy." + }, + "chatConversations": { + "description": "Required by the cozy Assistant", + "type": "io.cozy.ai.chat.conversations", + "verbs": ["GET", "POST"] + }, + "chatEvents": { + "description": "Required by the cozy Assistant", + "type": "io.cozy.ai.chat.events", + "verbs": ["GET"] } }, "accept_from_flagship": true, From 5a84c682cce390fe95b8843cfca95ef39ec925e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 13 Dec 2024 15:33:27 +0100 Subject: [PATCH 5/8] feat: Delete old search components --- src/assets/icons/icon-search-empty.svg | 6 - .../search/components/AppBarSearch.spec.jsx | 17 -- .../components/BarSearchAutosuggest.jsx | 148 ------------------ .../search/components/BarSearchInputGroup.jsx | 43 ----- src/modules/search/components/SearchEmpty.jsx | 44 ------ .../search/components/SuggestionItem.jsx | 63 -------- .../components/SuggestionItemSkeleton.jsx | 44 ------ .../SuggestionItemTextHighlighted.jsx | 104 ------------ .../SuggestionItemTextSecondary.jsx | 66 -------- .../components/SuggestionListSkeleton.jsx | 17 -- src/modules/search/components/helpers.js | 114 -------------- .../search/components/helpers.spec.jsx | 118 -------------- src/modules/search/components/styles.styl | 82 ---------- src/modules/search/hooks/useSearch.jsx | 90 ----------- src/modules/views/Search/SearchView.jsx | 145 ----------------- 15 files changed, 1101 deletions(-) delete mode 100644 src/assets/icons/icon-search-empty.svg delete mode 100644 src/modules/search/components/AppBarSearch.spec.jsx delete mode 100644 src/modules/search/components/BarSearchAutosuggest.jsx delete mode 100644 src/modules/search/components/BarSearchInputGroup.jsx delete mode 100644 src/modules/search/components/SearchEmpty.jsx delete mode 100644 src/modules/search/components/SuggestionItem.jsx delete mode 100644 src/modules/search/components/SuggestionItemSkeleton.jsx delete mode 100644 src/modules/search/components/SuggestionItemTextHighlighted.jsx delete mode 100644 src/modules/search/components/SuggestionItemTextSecondary.jsx delete mode 100644 src/modules/search/components/SuggestionListSkeleton.jsx delete mode 100644 src/modules/search/components/helpers.js delete mode 100644 src/modules/search/components/helpers.spec.jsx delete mode 100644 src/modules/search/components/styles.styl delete mode 100644 src/modules/search/hooks/useSearch.jsx delete mode 100644 src/modules/views/Search/SearchView.jsx diff --git a/src/assets/icons/icon-search-empty.svg b/src/assets/icons/icon-search-empty.svg deleted file mode 100644 index 5dc84c4f71..0000000000 --- a/src/assets/icons/icon-search-empty.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/modules/search/components/AppBarSearch.spec.jsx b/src/modules/search/components/AppBarSearch.spec.jsx deleted file mode 100644 index 78401ede6e..0000000000 --- a/src/modules/search/components/AppBarSearch.spec.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import { render, screen } from '@testing-library/react' -import React from 'react' - -import CozyClient from 'cozy-client' - -import AppBarSearch from 'modules/search/components/AppBarSearch' -import AppLike from 'test/components/AppLike' - -it('should display the Searchbar', () => { - const client = new CozyClient({}) - render( - - - - ) - expect(screen.getByPlaceholderText('Search anything')).toBeInTheDocument() -}) diff --git a/src/modules/search/components/BarSearchAutosuggest.jsx b/src/modules/search/components/BarSearchAutosuggest.jsx deleted file mode 100644 index 40c7db23a7..0000000000 --- a/src/modules/search/components/BarSearchAutosuggest.jsx +++ /dev/null @@ -1,148 +0,0 @@ -import cx from 'classnames' -import React, { useState } from 'react' -import Autosuggest from 'react-autosuggest' - -import { models, useClient } from 'cozy-client' -import { isFlagshipApp } from 'cozy-device-helper' -import { useWebviewIntent } from 'cozy-intent' -import List from 'cozy-ui/transpiled/react/List' - -import { SHARED_DRIVES_DIR_ID } from 'constants/config' -import BarSearchInputGroup from 'modules/search/components/BarSearchInputGroup' -import SuggestionItem from 'modules/search/components/SuggestionItem' -import SuggestionListSkeleton from 'modules/search/components/SuggestionListSkeleton' -import useSearch from 'modules/search/hooks/useSearch' - -import styles from 'modules/search/components/styles.styl' - -const BarSearchAutosuggest = ({ t }) => { - const webviewIntent = useWebviewIntent() - const client = useClient() - - const [input, setInput] = useState('') - const [searchTerm, setSearchTerm] = useState('') - const { suggestions, hasSuggestions, isBusy, query, makeIndexes } = - useSearch(searchTerm) - const [focused, setFocused] = useState(false) - - const theme = { - container: 'u-w-100', - suggestionsContainer: - styles['bar-search-autosuggest-suggestions-container'], - suggestionsContainerOpen: - styles['bar-search-autosuggest-suggestions-container--open'], - suggestionsList: styles['bar-search-autosuggest-suggestions-list'] - } - - const onSuggestionsFetchRequested = ({ value }) => { - setSearchTerm(value) - } - const onSuggestionsClearRequested = () => { - setSearchTerm('') - } - - const cleanSearch = () => { - setInput('') - setSearchTerm('') - } - - const onSuggestionSelected = async (event, { suggestion }) => { - // Open the shared drive in a new tab - if (suggestion.parentUrl?.includes(SHARED_DRIVES_DIR_ID)) { - window.open(`/#/external/${suggestion.id}`, '_blank') - return cleanSearch() - } - - let url = `${window.location.origin}/#${suggestion.url}` - if (suggestion.openOn === 'notes') { - url = await models.note.fetchURL(client, { - id: suggestion.url.substr(3) - }) - } - - if (url) { - if (isFlagshipApp()) { - webviewIntent.call('openApp', url, { slug: suggestion.openOn }) - } else { - window.location.assign(url) - } - } else { - // eslint-disable-next-line no-console - console.error(`openSuggestion (${suggestion.name}) could not be executed`) - } - cleanSearch() - } - - // We want the user to find folders in which he can then navigate into, so we return the path here - const getSuggestionValue = suggestion => suggestion.subtitle - - const renderSuggestion = suggestion => { - return ( - - ) - } - - const inputProps = { - placeholder: t('searchbar.placeholder'), - value: input, - onChange: (event, { newValue }) => { - setInput(newValue) - }, - onFocus: () => { - makeIndexes() - setFocused(true) - }, - onBlur: () => setFocused(false) - } - - const renderInputComponent = inputProps => ( - - - - ) - - const renderSuggestionsContainer = ({ containerProps, children }) => { - return {children} - } - - const hasNoSearchResult = searchTerm !== '' && focused && !hasSuggestions - - return ( -
- - {hasNoSearchResult && !isBusy && ( -
- {t('searchbar.empty', { query })} -
- )} - {hasNoSearchResult && isBusy && ( -
- -
- )} -
- ) -} - -export default BarSearchAutosuggest diff --git a/src/modules/search/components/BarSearchInputGroup.jsx b/src/modules/search/components/BarSearchInputGroup.jsx deleted file mode 100644 index 92dc93ea0c..0000000000 --- a/src/modules/search/components/BarSearchInputGroup.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react' - -import Icon from 'cozy-ui/transpiled/react/Icon' -import IconButton from 'cozy-ui/transpiled/react/IconButton' -import CrossCircleOutlineIcon from 'cozy-ui/transpiled/react/Icons/CrossCircleOutline' -import Magnifier from 'cozy-ui/transpiled/react/Icons/Magnifier' -import InputGroup from 'cozy-ui/transpiled/react/InputGroup' - -import styles from 'modules/search/components/styles.styl' - -const BarSearchInputGroup = ({ - children, - isMobile, - onClean, - isInputNotEmpty -}) => { - return ( - - ) -} - -export default BarSearchInputGroup diff --git a/src/modules/search/components/SearchEmpty.jsx b/src/modules/search/components/SearchEmpty.jsx deleted file mode 100644 index f7ae8c674f..0000000000 --- a/src/modules/search/components/SearchEmpty.jsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react' - -import Grid from 'cozy-ui/transpiled/react/Grid' -import Icon from 'cozy-ui/transpiled/react/Icon' -import Typography from 'cozy-ui/transpiled/react/Typography' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -import searchEmptyIllustration from 'assets/icons/icon-search-empty.svg' - -const SearchEmpty = ({ query }) => { - const { t } = useI18n() - - return ( - - - - - - {t('search.empty.title', { query })} - - - - - {t('search.empty.subtitle', { query })} - - - - ) -} - -export default SearchEmpty diff --git a/src/modules/search/components/SuggestionItem.jsx b/src/modules/search/components/SuggestionItem.jsx deleted file mode 100644 index c37810da26..0000000000 --- a/src/modules/search/components/SuggestionItem.jsx +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useCallback } from 'react' - -import ListItem from 'cozy-ui/transpiled/react/ListItem' -import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon' -import ListItemText from 'cozy-ui/transpiled/react/ListItemText' - -import { SHARED_DRIVES_DIR_ID } from 'constants/config' -import FileIconMime from 'modules/filelist/icons/FileIconMime' -import FileIconShortcut from 'modules/filelist/icons/FileIconShortcut' -import SuggestionItemTextHighlighted from 'modules/search/components/SuggestionItemTextHighlighted' -import SuggestionItemTextSecondary from 'modules/search/components/SuggestionItemTextSecondary' - -const SuggestionItem = ({ - suggestion, - query, - onClick, - onParentOpened, - isMobile = false -}) => { - const openSuggestion = useCallback(() => { - if (typeof onClick == 'function') { - onClick(suggestion) - } - }, [onClick, suggestion]) - - const file = { - class: suggestion.class, - type: suggestion.type, - mime: suggestion.mime, - name: suggestion.title.replace(/\.url$/, ''), // Not using `splitFileName()` because we don't have access to the full file here. - parentUrl: suggestion.parentUrl - } - - return ( - - - {file.class === 'shortcut' ? ( - - ) : ( - - )} - - - } - secondary={ - file.parentUrl?.includes(SHARED_DRIVES_DIR_ID) ? null : ( - - ) - } - /> - - ) -} - -export default SuggestionItem diff --git a/src/modules/search/components/SuggestionItemSkeleton.jsx b/src/modules/search/components/SuggestionItemSkeleton.jsx deleted file mode 100644 index a39fae978f..0000000000 --- a/src/modules/search/components/SuggestionItemSkeleton.jsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react' - -import ListItem from 'cozy-ui/transpiled/react/ListItem' -import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon' -import ListItemText from 'cozy-ui/transpiled/react/ListItemText' -import Skeleton from 'cozy-ui/transpiled/react/Skeleton' - -const SuggestionItemSkeleton = () => { - return ( - - - - - - } - secondary={ - - } - /> - - ) -} - -export default SuggestionItemSkeleton diff --git a/src/modules/search/components/SuggestionItemTextHighlighted.jsx b/src/modules/search/components/SuggestionItemTextHighlighted.jsx deleted file mode 100644 index 1cb6ff5049..0000000000 --- a/src/modules/search/components/SuggestionItemTextHighlighted.jsx +++ /dev/null @@ -1,104 +0,0 @@ -import React from 'react' - -import { normalizeString } from 'modules/search/components/helpers' - -/** - * Add on part that equlas query into each result - * - * @param {Array} searchResult - list of results - * @param {string} query - search input - * @returns list of results with the query highlighted - */ -const highlightQueryTerms = (searchResult, query) => { - const normalizedQueryTerms = normalizeString(query) - const normalizedResultTerms = normalizeString(searchResult) - - const matchedIntervals = [] - const spacerLength = 1 - let currentIndex = 0 - - normalizedResultTerms.forEach(resultTerm => { - normalizedQueryTerms.forEach(queryTerm => { - const index = resultTerm.indexOf(queryTerm) - if (index >= 0) { - matchedIntervals.push({ - from: currentIndex + index, - to: currentIndex + index + queryTerm.length - }) - } - }) - - currentIndex += resultTerm.length + spacerLength - }) - - // matchedIntervals can overlap, so we merge them. - // - sort the intervals by starting index - // - add the first interval to the stack - // - for every interval, - // - - add it to the stack if it doesn't overlap with the stack top - // - - or extend the stack top if the start overlaps and the new interval's top is bigger - const mergedIntervals = matchedIntervals - .sort((intervalA, intervalB) => intervalA.from > intervalB.from) - .reduce((computedIntervals, newInterval) => { - if ( - computedIntervals.length === 0 || - computedIntervals[computedIntervals.length - 1].to < newInterval.from - ) { - computedIntervals.push(newInterval) - } else if ( - computedIntervals[computedIntervals.length - 1].to < newInterval.to - ) { - computedIntervals[computedIntervals.length - 1].to = newInterval.to - } - - return computedIntervals - }, []) - - // create an array containing the entire search result, with special characters, and the intervals surrounded y `` tags - const slicedOriginalResult = - mergedIntervals.length > 0 - ? [{searchResult.slice(0, mergedIntervals[0].from)}] - : searchResult - - for (let i = 0, l = mergedIntervals.length; i < l; ++i) { - slicedOriginalResult.push( - - {searchResult.slice(mergedIntervals[i].from, mergedIntervals[i].to)} - - ) - if (i + 1 < l) - slicedOriginalResult.push( - - {searchResult.slice( - mergedIntervals[i].to, - mergedIntervals[i + 1].from - )} - - ) - } - - if (mergedIntervals.length > 0) - slicedOriginalResult.push( - - {searchResult.slice( - mergedIntervals[mergedIntervals.length - 1].to, - searchResult.length - )} - - ) - - return slicedOriginalResult -} - -const SuggestionItemTextHighlighted = ({ text, query }) => { - const textHighlighted = highlightQueryTerms(text, query) - if (Array.isArray(textHighlighted)) { - return textHighlighted.map((item, idx) => ({ - ...item, - key: idx - })) - } - return textHighlighted -} - -export default SuggestionItemTextHighlighted diff --git a/src/modules/search/components/SuggestionItemTextSecondary.jsx b/src/modules/search/components/SuggestionItemTextSecondary.jsx deleted file mode 100644 index 8680a0b08d..0000000000 --- a/src/modules/search/components/SuggestionItemTextSecondary.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react' - -import { generateWebLink, useClient } from 'cozy-client' -import { isFlagshipApp } from 'cozy-device-helper' -import AppLinker, { - generateUniversalLink -} from 'cozy-ui/transpiled/react/AppLinker' - -import SuggestionItemTextHighlighted from 'modules/search/components/SuggestionItemTextHighlighted' - -import styles from 'modules/search/components/styles.styl' - -const SuggestionItemTextSecondary = ({ - text, - query, - url, - onOpened, - isMobile -}) => { - const client = useClient() - - if (isMobile) { - return - } - - const app = { - slug: 'drive' - } - - const { subdomain: subDomainType } = client.getInstanceOptions() - const generateLink = isFlagshipApp() ? generateUniversalLink : generateWebLink - - const appWebRef = - app && - generateLink({ - slug: 'drive', - cozyUrl: client.getStackClient().uri, - subDomainType, - nativePath: url, - pathname: '/', - hash: url - }) - return ( - - {({ onClick, href }) => ( - { - e.stopPropagation() - if (typeof onOpened == 'function') { - onOpened(e) - } - if (typeof onClick == 'function') { - onClick(e) - } - }} - > - - - )} - - ) -} - -export default SuggestionItemTextSecondary diff --git a/src/modules/search/components/SuggestionListSkeleton.jsx b/src/modules/search/components/SuggestionListSkeleton.jsx deleted file mode 100644 index f6011386b9..0000000000 --- a/src/modules/search/components/SuggestionListSkeleton.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react' - -import List from 'cozy-ui/transpiled/react/List' - -import SuggestionItemSkeleton from 'modules/search/components/SuggestionItemSkeleton' - -const SuggestionListSkeleton = ({ count }) => ( - - {Array(count || 4) - .fill(1) - .map((_, i) => ( - - ))} - -) - -export default SuggestionListSkeleton diff --git a/src/modules/search/components/helpers.js b/src/modules/search/components/helpers.js deleted file mode 100644 index 2f4594ed46..0000000000 --- a/src/modules/search/components/helpers.js +++ /dev/null @@ -1,114 +0,0 @@ -import { models } from 'cozy-client' - -import { ROOT_DIR_ID, SHARED_DRIVES_DIR_ID } from 'constants/config' -import FuzzyPathSearch from 'lib/FuzzyPathSearch.js' -import { isEncryptedFolder } from 'lib/encryption' -import { makeOnlyOfficeFileRoute } from 'modules/views/OnlyOffice/helpers' - -export const TYPE_DIRECTORY = 'directory' - -export const normalizeString = str => - str - .toString() - .toLowerCase() - .replace(/\//g, ' ') - .normalize('NFD') - .replace(/[\u0300-\u036f]/g, '') - .split(' ') - -/** - * Normalize file for Front usage in component inside - * - * To reduce API call, the fetching of Note URL has been delayed - * inside an onSelect function called only if provided to - * see https://github.com/cozy/cozy-drive/pull/2663#discussion_r938671963 - * - * @param {CozyClient} client - cozy client instance - * @param {[IOCozyFile]} folders - all the folders returned by API - * @param {IOCozyFile} file - file to normalize - * @returns file with normalized field to be used in AutoSuggestion - */ -export const makeNormalizedFile = (client, folders, file) => { - const isDir = file.type === TYPE_DIRECTORY - const dirId = isDir ? file._id : file.dir_id - const urlToFolder = `/folder/${dirId}` - - let path, url, parentUrl - let openOn = 'drive' - if (isDir) { - path = file.path - url = urlToFolder - parentUrl = urlToFolder - } else { - const parentDir = folders.find(folder => folder._id === file.dir_id) - path = parentDir && parentDir.path ? parentDir.path : '' - parentUrl = parentDir && parentDir._id ? `/folder/${parentDir._id}` : '' - if (models.file.isNote(file)) { - url = `/n/${file.id}` - openOn = 'notes' - } else if (models.file.shouldBeOpenedByOnlyOffice(file)) { - url = makeOnlyOfficeFileRoute(file.id, { fromPathname: urlToFolder }) - } else { - url = `${urlToFolder}/file/${file._id}` - } - } - - return { - id: file._id, - type: file.type, - name: file.name, - mime: file.mime, - class: file.class, - path, - url, - parentUrl, - openOn, - isEncrypted: isEncryptedFolder(file) - } -} - -/** - * Fetches all files without trashed and preloads FuzzyPathSearch - * - * Using _all_docs route - * - * Also, this method: - * - removing trashed data directly - * - removes orphan file - * - normalize file to match expectation - * - preloads FuzzyPathSearch - * - * @returns {Promise} nothing - */ -export const indexFiles = async client => { - const resp = await client - .getStackClient() - .fetchJSON( - 'GET', - '/data/io.cozy.files/_all_docs?Fields=_id,trashed,dir_id,name,path,type,mime,class,metadata.title,metadata.version&DesignDocs=false&include_docs=true' - ) - const files = resp.rows.map(row => ({ id: row.id, ...row.doc })) - const folders = files.filter(file => file.type === TYPE_DIRECTORY) - - const notInTrash = file => !file.trashed && !/^\/\.cozy_trash/.test(file.path) - const notOrphans = file => - folders.find(folder => folder._id === file.dir_id) !== undefined - const notRoot = file => file._id !== ROOT_DIR_ID - // Shared drives folder to be hidden in search. - // The files inside it though must appear. Thus only the file with the folder ID is filtered out. - const notSharedDrivesDir = file => file._id !== SHARED_DRIVES_DIR_ID - - const normalizedFilesPrevious = files.filter( - file => - notInTrash(file) && - notOrphans(file) && - notRoot(file) && - notSharedDrivesDir(file) - ) - - const normalizedFiles = normalizedFilesPrevious.map(file => - makeNormalizedFile(client, folders, file) - ) - - return new FuzzyPathSearch(normalizedFiles) -} diff --git a/src/modules/search/components/helpers.spec.jsx b/src/modules/search/components/helpers.spec.jsx deleted file mode 100644 index e263019295..0000000000 --- a/src/modules/search/components/helpers.spec.jsx +++ /dev/null @@ -1,118 +0,0 @@ -import { createMockClient, models } from 'cozy-client' - -import { makeNormalizedFile, TYPE_DIRECTORY } from './helpers' - -models.note.fetchURL = jest.fn(() => 'noteUrl') - -const client = createMockClient({}) - -const noteFileProps = { - name: 'note.cozy-note', - metadata: { - content: '', - schema: '', - title: '', - version: '' - } -} - -describe('makeNormalizedFile', () => { - it('should return correct values for a directory', () => { - const folders = [] - const file = { - _id: 'fileId', - type: TYPE_DIRECTORY, - path: 'filePath', - name: 'fileName' - } - - const normalizedFile = makeNormalizedFile(client, folders, file) - - expect(normalizedFile).toEqual({ - id: 'fileId', - name: 'fileName', - path: 'filePath', - url: '/folder/fileId', - parentUrl: '/folder/fileId', - openOn: 'drive', - isEncrypted: false, - mime: undefined, - type: 'directory' - }) - }) - - it('should return correct values for a file', () => { - const folders = [{ _id: 'folderId', path: 'folderPath' }] - const file = { - _id: 'fileId', - dir_id: 'folderId', - type: 'file', - name: 'fileName' - } - - const normalizedFile = makeNormalizedFile(client, folders, file) - - expect(normalizedFile).toEqual({ - id: 'fileId', - name: 'fileName', - path: 'folderPath', - url: '/folder/folderId/file/fileId', - parentUrl: '/folder/folderId', - openOn: 'drive', - isEncrypted: false, - mime: undefined, - type: 'file' - }) - }) - - it('should return correct values for a note with on Select function - better for performance', () => { - const folders = [{ _id: 'folderId', path: 'folderPath' }] - const file = { - _id: 'fileId', - id: 'noteId', - dir_id: 'folderId', - type: 'file', - name: 'fileName', - ...noteFileProps - } - - const normalizedFile = makeNormalizedFile(client, folders, file) - - expect(normalizedFile).toEqual({ - id: 'fileId', - name: 'note.cozy-note', - path: 'folderPath', - url: '/n/noteId', - parentUrl: '/folder/folderId', - openOn: 'notes', - isEncrypted: false, - mime: undefined, - type: 'file' - }) - }) - - it('should not return filled onSelect for a note without metadata', () => { - const folders = [{ _id: 'folderId', path: 'folderPath' }] - const file = { - _id: 'fileId', - id: 'noteId', - dir_id: 'folderId', - type: 'file', - name: 'note.cozy-note' - } - - const normalizedFile = makeNormalizedFile(client, folders, file) - - expect(normalizedFile).toEqual({ - id: 'fileId', - name: 'note.cozy-note', - path: 'folderPath', - url: '/folder/folderId/file/fileId', - parentUrl: '/folder/folderId', - openOn: 'drive', - isEncrypted: false, - mime: undefined, - type: 'file' - }) - }) -}) diff --git a/src/modules/search/components/styles.styl b/src/modules/search/components/styles.styl deleted file mode 100644 index db89498f03..0000000000 --- a/src/modules/search/components/styles.styl +++ /dev/null @@ -1,82 +0,0 @@ -[role=banner] - .bar-search-autosuggest-suggestions-container - position absolute - top 100% - width 100% - max-height em(170px) - overflow auto - border-radius .5em - color var(--primaryTextColor) - background var(--paperBackgroundColor) - box-shadow var(--shadow7) - display none - box-sizing border-box - - .bar-search-autosuggest-suggestions-container--open - display block - - .bar-search-autosuggest-status-container - position absolute - display flex - align-items center - top 100% - left 0 - right 0 - min-height 48px - max-height em(170px) - overflow auto - border-radius .5em - background var(--paperBackgroundColor) - box-shadow var(--shadow7) - box-sizing border-box - - &.--empty - padding .75em 1em - - .bar-search-autosuggest-suggestions-list - margin 0 - padding 0 - list-style none - - .bar-search-container - position relative - display flex - align-items center - flex-grow 1 - margin-left 2em - margin-right 2em - padding-top .25em - padding-bottom .25em - - &.mobile - margin-left 0 - margin-right -.5em - - .bar-search-input-group - border 0 - max-height 40px - padding-left .5em - border-radius 1.25em - background-color var(--defaultBackgroundColor) - transition all .2s ease-out - overflow hidden - - &:hover - background linear-gradient(0deg, var(--actionColorHover), var(--actionColorHover)), var(--defaultBackgroundColor) - - .bar-search-input-group-append - padding-left .5em - color var(--secondaryTextColor) - - input - padding-left .5em - background-color transparent - max-width 100% - height 100% - -.suggestion-item-parent-link - color var(--secondaryTextColor) - text-decoration none - - &:hover - text-decoration underline diff --git a/src/modules/search/hooks/useSearch.jsx b/src/modules/search/hooks/useSearch.jsx deleted file mode 100644 index 95134f835b..0000000000 --- a/src/modules/search/hooks/useSearch.jsx +++ /dev/null @@ -1,90 +0,0 @@ -import { useState, useEffect, useMemo } from 'react' - -import { useClient } from 'cozy-client' - -import useDebounce from 'hooks/useDebounce' -import { indexFiles } from 'modules/search/components/helpers' - -const useSearch = (searchTerm, { limit = 10 } = {}) => { - const client = useClient() - const [allSuggestions, setAllSuggestions] = useState([]) - const [suggestions, setSuggestions] = useState([]) - const [fuzzy, setFuzzy] = useState(null) - const [isBusy, setBusy] = useState(true) - const [query, setQuery] = useState('') - - const debouncedSearchTerm = useDebounce(searchTerm, { - delay: 500, - ignore: searchTerm === '' - }) - - const makeIndexes = async () => { - if (fuzzy == null) { - setFuzzy(await indexFiles(client)) - } - } - - useEffect(() => { - const fetchSuggestions = async value => { - setBusy(true) - let currentFuzzy = fuzzy - if (currentFuzzy == null) { - currentFuzzy = await indexFiles(client) - setFuzzy(currentFuzzy) - } - const suggestions = currentFuzzy.search(value).map(result => ({ - id: result.id, - title: result.name, - subtitle: result.path, - url: result.url, - parentUrl: result.parentUrl, - openOn: result.openOn, - type: result.type, - mime: result.mime, - isEncrypted: result.isEncrypted, - class: result.class - })) - - setBusy(value === '') // To prevent empty state to appear at the first search - setQuery(value) - setAllSuggestions(suggestions) - setSuggestions(suggestions.slice(0, limit)) - } - - if (debouncedSearchTerm !== '') { - fetchSuggestions(debouncedSearchTerm) - } else { - clearSuggestions() - } - }, [client, debouncedSearchTerm, fuzzy, limit]) - - const hasSuggestions = useMemo(() => suggestions.length > 0, [suggestions]) - - const hasMore = useMemo( - () => suggestions.length < allSuggestions.length, - [suggestions, allSuggestions] - ) - - const fetchMore = async () => { - setSuggestions(allSuggestions.slice(0, suggestions.length + limit)) - } - - const clearSuggestions = () => { - setBusy(true) - setQuery('') - setAllSuggestions([]) - setSuggestions([]) - } - - return { - suggestions, - hasSuggestions, - hasMore, - isBusy, - query, - makeIndexes, - fetchMore - } -} - -export default useSearch diff --git a/src/modules/views/Search/SearchView.jsx b/src/modules/views/Search/SearchView.jsx deleted file mode 100644 index 3828f954fd..0000000000 --- a/src/modules/views/Search/SearchView.jsx +++ /dev/null @@ -1,145 +0,0 @@ -import cx from 'classnames' -import React, { useState, useCallback } from 'react' -import { useEffect } from 'react' -import { useLocation, useNavigate } from 'react-router-dom' - -import { BarLeft, BarSearch } from 'cozy-bar' -import { models, useClient } from 'cozy-client' -import { isFlagshipApp } from 'cozy-device-helper' -import { useWebviewIntent } from 'cozy-intent' -import Input from 'cozy-ui/transpiled/react/Input' -import { Main } from 'cozy-ui/transpiled/react/Layout' -import List from 'cozy-ui/transpiled/react/List' -import LoadMore from 'cozy-ui/transpiled/react/LoadMore' -import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -import BackButton from 'components/Button/BackButton' -import BarSearchInputGroup from 'modules/search/components/BarSearchInputGroup' -import SearchEmpty from 'modules/search/components/SearchEmpty' -import SuggestionItem from 'modules/search/components/SuggestionItem' -import SuggestionListSkeleton from 'modules/search/components/SuggestionListSkeleton' -import useSearch from 'modules/search/hooks/useSearch' - -import styles from 'modules/search/components/styles.styl' - -const SearchView = () => { - const webviewIntent = useWebviewIntent() - const { search } = useLocation() - const navigate = useNavigate() - const { isMobile } = useBreakpoints() - const client = useClient() - - const [searchTerm, setSearchTerm] = useState('') - const { t } = useI18n() - const { - isBusy, - suggestions, - hasSuggestions, - query, - makeIndexes, - hasMore, - fetchMore - } = useSearch(searchTerm, { limit: 25 }) - - useEffect(() => { - makeIndexes() - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []) - - const onInputChanged = event => { - setSearchTerm(event.target.value) - } - - const navigateBack = useCallback(() => { - const params = new URLSearchParams(search) - const returnPath = params.get('returnPath') - navigate(returnPath ? returnPath : '/') - }, [navigate, search]) - - const openSuggestion = useCallback( - async suggestion => { - if (suggestion.openOn === 'drive') { - navigate(suggestion.url) - } else if (suggestion.openOn === 'notes') { - const url = await models.note.fetchURL(client, { - id: suggestion.url.substr(3) - }) - if (isFlagshipApp()) { - webviewIntent.call('openApp', url, { - slug: 'notes' - }) - } else { - window.location.assign(url) - } - } else { - // eslint-disable-next-line no-console - console.error( - `openSuggestion (${suggestion.name}) could not be executed` - ) - } - }, - [navigate, webviewIntent, client] - ) - - const handleCleanInput = () => { - setSearchTerm('') - } - - const hasNoSearchResult = searchTerm !== '' && !hasSuggestions - - return ( -
- {isMobile && ( - - - - )} - -
- - - -
-
- {hasSuggestions && ( - - {suggestions.map(suggestion => ( - - ))} - - )} - {hasMore && ( -
- -
- )} - {hasNoSearchResult && !isBusy && } - {hasNoSearchResult && isBusy && } -
- ) -} - -export default SearchView From c15c634700dc651fdc9663ecc561668156ee1f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 17 Dec 2024 13:54:03 +0100 Subject: [PATCH 6/8] fix: Do not import DataProxyProvider in public route --- src/components/App/App.jsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/App/App.jsx b/src/components/App/App.jsx index 051baff803..e48ff66ea7 100644 --- a/src/components/App/App.jsx +++ b/src/components/App/App.jsx @@ -26,15 +26,19 @@ const App = ({ isPublic, store, client, lang, polyglot, children }) => { - - - - - {children} - - - - + + + + + {isPublic ? ( + children + ) : ( + {children} + )} + + + + From b53265fa76ca45f69603ad3d468a837df5dbbe2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Wed, 18 Dec 2024 10:52:15 +0100 Subject: [PATCH 7/8] test: Mock cozy-dataproxy-lib --- jestHelpers/setup.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jestHelpers/setup.js b/jestHelpers/setup.js index 8b64b9fcfa..f640a98908 100644 --- a/jestHelpers/setup.js +++ b/jestHelpers/setup.js @@ -15,5 +15,12 @@ jest.mock('cozy-intent', () => ({ useWebviewIntent: jest.fn() })) +jest.mock('cozy-dataproxy-lib', () => ({ + DataProxyProvider: ({ children }) => children, + SearchDialog: () =>
SearchDialog
, + AssistantDialog: () =>
AssistantDialog
, + AssistantDesktop: () =>
AssistantDesktop
+})) + // see https://github.com/jsdom/jsdom/issues/1695 window.HTMLElement.prototype.scroll = function () {} From 2015e54c7cc5ecd73769bb97a20a7b9a320eb769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Wed, 18 Dec 2024 11:28:08 +0100 Subject: [PATCH 8/8] chore: Adjust bundlemon config stop blocking PR for +4kB, use bundlemon monitor to check weight peaks --- .bundlemonrc | 82 +++++++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 55 deletions(-) diff --git a/.bundlemonrc b/.bundlemonrc index b9fddd5dcf..426b29e967 100644 --- a/.bundlemonrc +++ b/.bundlemonrc @@ -2,108 +2,82 @@ "baseDir": "./build", "files": [ { - "path": "app/drive..js", - "maxSize": "300 KB" + "path": "app/drive..js" }, { - "path": "app/drive..min.css", - "maxSize": "55 KB" + "path": "app/drive..min.css" }, { - "path": "img/app-icon..svg", - "maxSize": "1 KB" + "path": "img/app-icon..svg" }, { - "path": "intents/drive..js", - "maxSize": "190 KB" + "path": "intents/drive..js" }, { - "path": "intents/drive..min.css", - "maxSize": "37 KB" + "path": "intents/drive..min.css" }, { - "path": "intents/index.html", - "maxSize": "1 KB" + "path": "intents/index.html" }, { - "path": "onlyOffice/slide.pptx", - "maxSize": "25 KB" + "path": "onlyOffice/slide.pptx" }, { - "path": "onlyOffice/spreadsheet.xlsx", - "maxSize": "6 KB" + "path": "onlyOffice/spreadsheet.xlsx" }, { - "path": "onlyOffice/text.docx", - "maxSize": "6 KB" + "path": "onlyOffice/text.docx" }, { - "path": "public/cozy-bar.css", - "maxSize": "24 KB" + "path": "public/cozy-bar.css" }, { - "path": "public/cozy-bar.js", - "maxSize": "854 KB" + "path": "public/cozy-bar.js" }, { - "path": "public/cozy-client-js.js", - "maxSize": "160 KB" + "path": "public/cozy-client-js.js" }, { - "path": "public/drive..js", - "maxSize": "1.70 MB" + "path": "public/drive..js" }, { - "path": "public/drive..min.css", - "maxSize": "100 KB" + "path": "public/drive..min.css" }, { - "path": "public/pdf.worker.entry..worker.js", - "maxSize": "350 KB" + "path": "public/pdf.worker.entry..worker.js" }, { - "path": "services/dacc/drive.js", - "maxSize": "500 KB" + "path": "services/dacc/drive.js" }, { - "path": "services/qualificationMigration/drive.js", - "maxSize": "500 KB" + "path": "services/qualificationMigration/drive.js" }, { - "path": "vendors/drive...min.css", - "maxSize": "35 KB" + "path": "vendors/drive...min.css" }, { - "path": "vendors/drive..js", - "maxSize": "2.0 MB" + "path": "vendors/drive..js" }, { - "path": "app-drive..min.css", - "maxSize": "56 KB" + "path": "app-drive..min.css" }, { - "path": "index.html", - "maxSize": "1 KB" + "path": "index.html" }, { - "path": "intents-drive..min.css", - "maxSize": "40 KB" + "path": "intents-drive..min.css" }, { - "path": "manifest.json", - "maxSize": "1 KB" + "path": "manifest.json" }, { - "path": "manifest.webapp", - "maxSize": "2 KB" + "path": "manifest.webapp" }, { - "path": "public-drive..min.css", - "maxSize": "100 KB" + "path": "public-drive..min.css" }, { - "path": "vendors-drive..min.css", - "maxSize": "1 B" + "path": "vendors-drive..min.css" } ], "groups": [ @@ -129,7 +103,5 @@ "path": "vendors/**" } ], - "reportOutput": [ - "github" - ] + "reportOutput": ["github"] }