From e332a84f91063b447b9fe57b243b4ea9f10ac200 Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Tue, 16 Nov 2021 15:06:51 +0100 Subject: [PATCH 01/12] Bump version to 0.36.0-alpha --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7b52f5e517..e4e7aa65de 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.35.0 +0.36.0-alpha From 3f03c82ffd12eb6949ca742ef3da6c56f0e8d9f3 Mon Sep 17 00:00:00 2001 From: Pascal Holy <54705263+pascal-airy@users.noreply.github.com> Date: Wed, 17 Nov 2021 09:02:11 +0100 Subject: [PATCH 02/12] [#1294] Add monitoring docs (#2569) Resolves #2569 --- .../guides/{operations.md => monitoring.md} | 54 ++++++++++++------- docs/sidebars.js | 2 +- 2 files changed, 37 insertions(+), 19 deletions(-) rename docs/docs/guides/{operations.md => monitoring.md} (50%) diff --git a/docs/docs/guides/operations.md b/docs/docs/guides/monitoring.md similarity index 50% rename from docs/docs/guides/operations.md rename to docs/docs/guides/monitoring.md index 25a1781f99..088861d504 100644 --- a/docs/docs/guides/operations.md +++ b/docs/docs/guides/monitoring.md @@ -1,23 +1,23 @@ --- -title: How to monitor Airy Core -sidebar_label: Operations +title: Monitoring +sidebar_label: Monitoring --- ## Why Prometheus -Prometheus has become the mainstream monitoring tool of choice in the container -and microservice world. +Prometheus has become the mainstream open source monitoring tool of choice in +the container and microservice world. It provides ready-to-use [Exporters](https://prometheus.io/docs/instrumenting/exporters/) for all services that our system provides and implements a pull mechanism that is better suited for microservice architecture. -Furthermore, it supports additional components like the [Alert +Furthermore, it supports additional features like the [Alert Manager](https://prometheus.io/docs/alerting/latest/alertmanager/), [a query language](https://prometheus.io/docs/prometheus/latest/querying/basics/) to -retrieve the data and visualization tools like +retrieve the data and the visualization tool [Grafana](https://prometheus.io/docs/visualization/grafana/) ![image](https://user-images.githubusercontent.com/54705263/111768039-b2772200-88a7-11eb-9635-020895eb0c72.png) @@ -40,18 +40,26 @@ helm install prometheus prometheus-community/kube-prometheus-stack ### Customizing Prometheus +In this section you can customize the Prometheus chart by changing the defaults +in `infrastructure/tools/prometheus/values.yaml` to ones that suite your +requirements. + To access Prometheus, Grafana and Alertmanager from outside the cluster you have -to put your hostname in the respective `hosts: []` variable in -`infrastructure/tools/prometheus/values.yaml` and then create the Kubernetes ingress with: +to put your hostname in the respective `hosts: []` variable. -`helm upgrade prometheus --values infrastructure/tools/prometheus/values.yaml` +In the case that you make Grafana publicly accessible you should also set the +`adminPassword` to something secure. + +You can apply those changes by running: -Now you can access Prometheus under `/prometheus`. +`helm upgrade prometheus --values infrastructure/tools/prometheus/values.yaml` ### Grafana Dashboards [Grafana](https://grafana.com/) is a very powerful visualization tool which can -be used for all sorts of dashboard and monitoring requirements. +be used for all sorts of dashboarding and monitoring tasks. + +For Grafana there is one more step to do before you can access it. `k edit cm prometheus-grafana` @@ -62,19 +70,29 @@ be used for all sorts of dashboard and monitoring requirements. serve_from_sub_path = true ``` -Access Grafana under `/grafana` and login with the -`adminPassword` you set in the `values.yaml`. +Access Grafana under `/grafana` and login with the `adminPassword` you set in +the `values.yaml`. #### Access Predefined Dashboards If the `defaultDashboardsEnabled` is set to true you can find the default Kubernetes dashboards under `/grafana/dashboards` -For the spring apps we recommend to import this -(dashboard)[https://grafana.com/grafana/dashboards/12464]. +The Grafana website provides a lot more dashboards that can be added to your +instance by +[importing](https://grafana.com/docs/grafana/latest/dashboards/export-import/#import-dashboard) +them. + +Here is a list of dashboard we recommend to add to monitor your Airy Core +instance -And for Kafka this (dashboard)[https://grafana.com/grafana/dashboards/7589]. +- [Spring apps](https://grafana.com/grafana/dashboards/12464) +- [Apache Kafka](https://grafana.com/grafana/dashboards/7589) -### Monitoring with alerts +### Receiving alerts -Access the Alertmanager under `/alertmanager`. +To get notifications for the default alerts all you have to do is set up a +receiver like described +[here](https://grafana.com/docs/grafana/latest/dashboards/export-import/#import-dashboard). +That way you can get notified on Slack or PagerDuty on issues like crashing +components and nodes running out of free storage space. diff --git a/docs/sidebars.js b/docs/sidebars.js index c7e4f07b8c..184e44c1da 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -85,7 +85,7 @@ module.exports = { ], }, { - '📚 Guides': ['guides/contributing', 'guides/analytics-demo', 'guides/backup'], + '📚 Guides': ['guides/contributing', 'guides/analytics-demo', 'guides/monitoring', 'guides/backup'], }, 'changelog', ], From 42384f59e9bec31533fb9c4e5817c88df608f213 Mon Sep 17 00:00:00 2001 From: Aitor Algorta Date: Wed, 17 Nov 2021 11:31:29 +0100 Subject: [PATCH 03/12] =?UTF-8?q?fix=20chatplugin=20customization=20overlo?= =?UTF-8?q?ad=C2=B4=20(#2592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/src/airyRenderProps/AiryInputBar/index.tsx | 4 ++-- .../Airy/ChatPlugin/sections/CustomiseSection.module.scss | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx index 8022027af0..9e95710698 100644 --- a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx +++ b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx @@ -29,8 +29,8 @@ const AiryInputBar = (props: AiryInputBarProps) => { const isMobileDevice = window.innerHeight < 1200 || window.innerWidth < 1000; useEffect(() => { - textInputRef.current.selectionStart = props.messageString.length; - textInputRef.current.selectionEnd = props.messageString.length; + textInputRef.current.selectionStart = props.messageString?.length ?? 0; + textInputRef.current.selectionEnd = props.messageString?.length ?? 0; }, []); const resizeTextarea = () => { diff --git a/frontend/ui/src/pages/Channels/Providers/Airy/ChatPlugin/sections/CustomiseSection.module.scss b/frontend/ui/src/pages/Channels/Providers/Airy/ChatPlugin/sections/CustomiseSection.module.scss index f3dc0716fb..959b0f0b2e 100644 --- a/frontend/ui/src/pages/Channels/Providers/Airy/ChatPlugin/sections/CustomiseSection.module.scss +++ b/frontend/ui/src/pages/Channels/Providers/Airy/ChatPlugin/sections/CustomiseSection.module.scss @@ -68,6 +68,8 @@ border-radius: 10px; padding: 0 24px 0 24px; margin: 32px 0 0 24px; + min-width: 350px; + min-height: 700px; } .pluginContainer { From 16bd7b5268680f64a6e9cac98570030d7fd01f0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:08:00 +0100 Subject: [PATCH 04/12] Bump eslint-plugin-react from 7.26.1 to 7.27.0 (#2588) Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.26.1 to 7.27.0. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.26.1...v7.27.0) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 183 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 128 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index 48daf404f3..69096a3ce8 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "css-loader": "^6.2.0", "cypress": "^8.7.0", "eslint": "^7.32.0", - "eslint-plugin-react": "^7.26.1", + "eslint-plugin-react": "^7.27.0", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.5.0", "minimist": "^1.2.5", diff --git a/yarn.lock b/yarn.lock index 7e50b2900d..143b9b2104 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1874,16 +1874,16 @@ array-flatten@^2.1.0: resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-includes@^3.1.2, array-includes@^3.1.3: - version "3.1.3" - resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== +array-includes@^3.1.2, array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" - is-string "^1.0.5" + is-string "^1.0.7" array-union@^1.0.1: version "1.0.2" @@ -1907,15 +1907,14 @@ array-unique@^0.3.2: resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flatmap@^1.2.4: - version "1.2.4" - resolved "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== +array.prototype.flatmap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446" + integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA== dependencies: call-bind "^1.0.0" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" + es-abstract "^1.19.0" asn1@~0.2.3: version "0.2.4" @@ -3125,7 +3124,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.1, es-abstract@^1.18.2: +es-abstract@^1.17.2, es-abstract@^1.18.0-next.1: version "1.18.3" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz" integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== @@ -3147,6 +3146,32 @@ es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.1" +es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" + object-inspect "^1.11.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + es-module-lexer@^0.9.0: version "0.9.1" resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.1.tgz" @@ -3181,25 +3206,25 @@ escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-react@^7.26.1: - version "7.26.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.1.tgz#41bcfe3e39e6a5ac040971c1af94437c80daa40e" - integrity sha512-Lug0+NOFXeOE+ORZ5pbsh6mSKjBKXDXItUD2sQoT+5Yl0eoT82DqnXeTMfUare4QVCn9QwXbfzO/dBLjLXwVjQ== +eslint-plugin-react@^7.27.0: + version "7.27.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.27.0.tgz#f952c76517a3915b81c7788b220b2b4c96703124" + integrity sha512-0Ut+CkzpppgFtoIhdzi2LpdpxxBvgFf99eFqWxJnUrO7mMe0eOiNpou6rvNYeVVV6lWZvTah0BFne7k5xHjARg== dependencies: - array-includes "^3.1.3" - array.prototype.flatmap "^1.2.4" + array-includes "^3.1.4" + array.prototype.flatmap "^1.2.5" doctrine "^2.1.0" - estraverse "^5.2.0" + estraverse "^5.3.0" jsx-ast-utils "^2.4.1 || ^3.0.0" minimatch "^3.0.4" - object.entries "^1.1.4" - object.fromentries "^2.0.4" - object.hasown "^1.0.0" - object.values "^1.1.4" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.0" + object.values "^1.1.5" prop-types "^15.7.2" resolve "^2.0.0-next.3" semver "^6.3.0" - string.prototype.matchall "^4.0.5" + string.prototype.matchall "^4.0.6" eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" @@ -3312,10 +3337,10 @@ estraverse@^4.1.1: resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" @@ -3775,6 +3800,14 @@ get-stream@^6.0.0: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" @@ -3938,6 +3971,13 @@ has-symbols@^1.0.1, has-symbols@^1.0.2: resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-value@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" @@ -4348,6 +4388,11 @@ is-callable@^1.1.4, is-callable@^1.2.3: resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== +is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + is-ci@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-ci/-/is-ci-3.0.0.tgz" @@ -4524,6 +4569,19 @@ is-regex@^1.0.4, is-regex@^1.1.3: call-bind "^1.0.2" has-symbols "^1.0.2" +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" @@ -4539,6 +4597,13 @@ is-string@^1.0.5, is-string@^1.0.6: resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz" integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== +is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz" @@ -4556,6 +4621,13 @@ is-unicode-supported@^0.1.0: resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-weakref@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" + integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== + dependencies: + call-bind "^1.0.0" + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" @@ -5495,7 +5567,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.10.3, object-inspect@^1.9.0: +object-inspect@^1.10.3, object-inspect@^1.11.0, object-inspect@^1.9.0: version "1.11.0" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz" integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== @@ -5530,24 +5602,23 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz" - integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== +object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" -object.fromentries@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.4.tgz" - integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has "^1.0.3" + es-abstract "^1.19.1" object.getownpropertydescriptors@^2.1.0: version "2.1.1" @@ -5558,13 +5629,13 @@ object.getownpropertydescriptors@^2.1.0: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -object.hasown@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/object.hasown/-/object.hasown-1.0.0.tgz" - integrity sha512-qYMF2CLIjxxLGleeM0jrcB4kiv3loGVAjKQKvH8pSU/i2VcRRvUNmxbD+nEMmrXRfORhuVJuH8OtSYCZoue3zA== +object.hasown@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5" + integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg== dependencies: define-properties "^1.1.3" - es-abstract "^1.18.1" + es-abstract "^1.19.1" object.pick@^1.3.0: version "1.3.0" @@ -5573,14 +5644,14 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0, object.values@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz" - integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== +object.values@^1.1.0, object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" @@ -7051,14 +7122,14 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.matchall@^4.0.5: - version "4.0.5" - resolved "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.5.tgz" - integrity sha512-Z5ZaXO0svs0M2xd/6By3qpeKpLKd9mO4v4q3oMEQrk8Ck4xOD5d5XeBOOjGrmVZZ/AHB1S0CgG4N5r1G9N3E2Q== +string.prototype.matchall@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" + integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.2" + es-abstract "^1.19.1" get-intrinsic "^1.1.1" has-symbols "^1.0.2" internal-slot "^1.0.3" From 7aa09c28db81121a67f2a52fe128ddeb7a851d4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:08:27 +0100 Subject: [PATCH 05/12] Bump react-i18next from 11.12.0 to 11.14.2 (#2581) Bumps [react-i18next](https://github.com/i18next/react-i18next) from 11.12.0 to 11.14.2. - [Release notes](https://github.com/i18next/react-i18next/releases) - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v11.12.0...v11.14.2) --- updated-dependencies: - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 69096a3ce8..a8e071fe0a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "react-autosize-textarea": "^7.1.0", "react-color": "^2.19.3", "react-dom": "17.0.2", - "react-i18next": "^11.12.0", + "react-i18next": "^11.14.2", "react-markdown": "^7.1.0", "react-modal": "^3.14.3", "react-redux": "7.2.6", diff --git a/yarn.lock b/yarn.lock index 143b9b2104..8ab02a3d58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6233,10 +6233,10 @@ react-hot-loader@^4.13.0: shallowequal "^1.1.0" source-map "^0.7.3" -react-i18next@^11.12.0: - version "11.12.0" - resolved "https://registry.npmjs.org/react-i18next/-/react-i18next-11.12.0.tgz" - integrity sha512-M9BT+hqVG03ywrl+L7CK74ugK+4jIo7AeKJ17+g9BoqJz2+/aVbs8SIVXT4KMQ1rjIdcw+GcSRDy1CXjcz6tLQ== +react-i18next@^11.14.2: + version "11.14.2" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.14.2.tgz#2ff28f6a0ddf06eaf79435ed6c70c441d709cf34" + integrity sha512-fmDhwNA0zDmSEL3BBT5qwNMvxrKu25oXDDAZyHprfB0AHZmWXfBmRLf8MX8i1iBd2I2C2vsA2D9wxYBIwzooEQ== dependencies: "@babel/runtime" "^7.14.5" html-parse-stringify "^3.0.1" From 8dd03468b89824c12b11079272298df577194b64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:08:51 +0100 Subject: [PATCH 06/12] Bump redux from 4.1.1 to 4.1.2 (#2566) Bumps [redux](https://github.com/reduxjs/redux) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/reduxjs/redux/releases) - [Changelog](https://github.com/reduxjs/redux/blob/master/CHANGELOG.md) - [Commits](https://github.com/reduxjs/redux/compare/v4.1.1...v4.1.2) --- updated-dependencies: - dependency-name: redux dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a8e071fe0a..ed18978527 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "react-modal": "^3.14.3", "react-redux": "7.2.6", "react-router-dom": "5.3.0", - "redux": "^4.1.1", + "redux": "^4.1.2", "regenerator-runtime": "^0.13.9", "reselect": "4.1.1", "typesafe-actions": "^5.1.0" diff --git a/yarn.lock b/yarn.lock index 8ab02a3d58..3fe782c59c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6392,10 +6392,10 @@ redux-thunk@^2.3.0: resolved "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz" integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw== -redux@^4.0.0, redux@^4.1.0, redux@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/redux/-/redux-4.1.1.tgz" - integrity sha512-hZQZdDEM25UY2P493kPYuKqviVwZ58lEmGQNeQ+gXa+U0gYPUBf7NKYazbe3m+bs/DzM/ahN12DbF+NG8i0CWw== +redux@^4.0.0, redux@^4.1.0, redux@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.2.tgz#140f35426d99bb4729af760afcf79eaaac407104" + integrity sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw== dependencies: "@babel/runtime" "^7.9.2" From 28f3c4ca1aabf6e3a3bc2eed3dba327475212de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 15:07:35 +0100 Subject: [PATCH 07/12] Bump @babel/core from 7.15.8 to 7.16.0 (#2595) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.15.8 to 7.16.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.16.0/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 270 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 190 insertions(+), 82 deletions(-) diff --git a/package.json b/package.json index ed18978527..efc2140b8c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "typesafe-actions": "^5.1.0" }, "devDependencies": { - "@babel/core": "7.15.8", + "@babel/core": "7.16.0", "@babel/plugin-proposal-class-properties": "^7.14.5", "@babel/plugin-proposal-object-rest-spread": "^7.14.5", "@babel/plugin-transform-spread": "^7.14.6", diff --git a/yarn.lock b/yarn.lock index 3fe782c59c..0e60a63a7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,32 +9,37 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" - integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== dependencies: - "@babel/highlight" "^7.14.5" + "@babel/highlight" "^7.16.0" "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0": version "7.15.0" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz" integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== -"@babel/core@7.15.8", "@babel/core@^7.12.3": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" - integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== - dependencies: - "@babel/code-frame" "^7.15.8" - "@babel/generator" "^7.15.8" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.8" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" +"@babel/compat-data@^7.16.0": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" + integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== + +"@babel/core@7.16.0", "@babel/core@^7.12.3": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" + integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" + "@babel/helpers" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,12 +47,12 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" - integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== +"@babel/generator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" + integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== dependencies: - "@babel/types" "^7.15.6" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" @@ -66,14 +71,14 @@ "@babel/helper-explode-assignable-expression" "^7.14.5" "@babel/types" "^7.14.5" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.15.4", "@babel/helper-compilation-targets@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" + integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== dependencies: - "@babel/compat-data" "^7.15.0" + "@babel/compat-data" "^7.16.0" "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + browserslist "^4.17.5" semver "^6.3.0" "@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": @@ -126,6 +131,15 @@ "@babel/template" "^7.15.4" "@babel/types" "^7.15.4" +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== + dependencies: + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" + "@babel/helper-get-function-arity@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz" @@ -133,6 +147,13 @@ dependencies: "@babel/types" "^7.15.4" +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== + dependencies: + "@babel/types" "^7.16.0" + "@babel/helper-hoist-variables@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz" @@ -140,6 +161,13 @@ dependencies: "@babel/types" "^7.15.4" +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== + dependencies: + "@babel/types" "^7.16.0" + "@babel/helper-member-expression-to-functions@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz" @@ -147,26 +175,40 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": +"@babel/helper-member-expression-to-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" + integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== + dependencies: + "@babel/types" "^7.16.0" + +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz" integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4", "@babel/helper-module-transforms@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" - integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== +"@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/types" "^7.16.0" + +"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4", "@babel/helper-module-transforms@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" + integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== + dependencies: + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" @@ -175,6 +217,13 @@ dependencies: "@babel/types" "^7.15.4" +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== + dependencies: + "@babel/types" "^7.16.0" + "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.14.5" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz" @@ -199,6 +248,16 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" +"@babel/helper-replace-supers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" + integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" + "@babel/helper-simple-access@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz" @@ -206,6 +265,13 @@ dependencies: "@babel/types" "^7.15.4" +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== + dependencies: + "@babel/types" "^7.16.0" + "@babel/helper-skip-transparent-expression-wrappers@^7.14.5", "@babel/helper-skip-transparent-expression-wrappers@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz" @@ -220,6 +286,13 @@ dependencies: "@babel/types" "^7.15.4" +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== + dependencies: + "@babel/types" "^7.16.0" + "@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz" @@ -240,16 +313,16 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helpers@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" + integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.3" + "@babel/types" "^7.16.0" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": +"@babel/highlight@^7.10.4": version "7.14.5" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz" integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== @@ -258,10 +331,19 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.15.4", "@babel/parser@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" - integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== + dependencies: + "@babel/helper-validator-identifier" "^7.15.7" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.16.0", "@babel/parser@^7.16.3": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" + integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": version "7.15.4" @@ -927,36 +1009,36 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4": - version "7.15.4" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/template@^7.15.4", "@babel/template@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" + integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.3" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.12.6", "@babel/types@^7.14.5", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.4.4": - version "7.15.6" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.12.6", "@babel/types@^7.14.5", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.16.0", "@babel/types@^7.4.4": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" "@bazel/typescript@^4.3.0": @@ -2162,7 +2244,7 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.17.3: +browserslist@^4.14.5, browserslist@^4.17.3: version "4.17.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.4.tgz#72e2508af2a403aec0a49847ef31bd823c57ead4" integrity sha512-Zg7RpbZpIJRW3am9Lyckue7PLytvVxxhJj1CaJVlCWENsGEAOlnlt8X0ZxGRPp7Bt9o8tIRM5SEXy4BCPMJjLQ== @@ -2173,6 +2255,17 @@ browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.17.3: node-releases "^2.0.0" picocolors "^1.0.0" +browserslist@^4.17.5: + version "4.18.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" + integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== + dependencies: + caniuse-lite "^1.0.30001280" + electron-to-chromium "^1.3.896" + escalade "^3.1.1" + node-releases "^2.0.1" + picocolors "^1.0.0" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz" @@ -2264,6 +2357,11 @@ caniuse-lite@^1.0.30001265: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001267.tgz#b1cf2937175afc0570e4615fc2d2f9069fa0ed30" integrity sha512-r1mjTzAuJ9W8cPBGbbus8E0SKcUP7gn03R14Wk8FlAlqhH9hroy9nLqmpuXlfKEw/oILW+FGz47ipXV2O7x8lg== +caniuse-lite@^1.0.30001280: + version "1.0.30001282" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" + integrity sha512-YhF/hG6nqBEllymSIjLtR2iWDDnChvhnVJqp+vloyt2tEHFG1yBR+ac2B/rOw0qOK0m0lEXU2dv4E/sMk5P9Kg== + caseless@~0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" @@ -3050,6 +3148,11 @@ electron-to-chromium@^1.3.867: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.870.tgz#c15c921e66a46985181b261f8093b91c2abb6604" integrity sha512-PiJMshfq6PL+i1V+nKLwhHbCKeD8eAz8rvO9Cwk/7cChOHJBtufmjajLyYLsSRHguRFiOCVx3XzJLeZsIAYfSA== +electron-to-chromium@^1.3.896: + version "1.3.900" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.900.tgz#5be2c5818a2a012c511b4b43e87b6ab7a296d4f5" + integrity sha512-SuXbQD8D4EjsaBaJJxySHbC+zq8JrFfxtb4GIr4E9n1BcROyMcRrJCYQNpJ9N+Wjf5mFp7Wp0OHykd14JNEzzQ== + emoji-mart@3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/emoji-mart/-/emoji-mart-3.0.1.tgz" @@ -5513,6 +5616,11 @@ node-releases@^2.0.0: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.0.tgz#67dc74903100a7deb044037b8a2e5f453bb05400" integrity sha512-aA87l0flFYMzCHpTM3DERFSYxc6lv/BltdbRTOMZuxZ0cwZCD3mejE5n9vLhSJCN++/eOqr77G1IO5uXxlQYWA== +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== + normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" From afe888a5da4b237c4cf7a817b5651f51d7de550f Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 19 Nov 2021 12:54:04 +0100 Subject: [PATCH 08/12] [#2119] Send/render attachments chatplugin (#2603) * working version UI * WIP * WIP' * WIP * working file selector solution * working drag and drop * changed accepted types * working version UI * WIP * WIP' * WIP * working file selector solution * working drag and drop * changed accepted types * fixed lint * run prettier * remove unnecessary configs * linting Co-authored-by: Aitor Algorta --- frontend/chat-plugin/dev/config.ts | 4 - .../InputSelector/index.module.scss | 46 ++++++ .../AiryInputBar/InputSelector/index.tsx | 84 +++++++++++ .../AiryInputBar/index.module.scss | 38 ++++- .../airyRenderProps/AiryInputBar/index.tsx | 132 ++++++++++++++--- frontend/chat-plugin/lib/src/api/index.tsx | 57 ++++++-- .../lib/src/components/chat/index.tsx | 135 ++++++++++-------- .../components/dragAndDrop/index.module.scss | 25 ++++ .../lib/src/components/dragAndDrop/index.tsx | 56 ++++++++ frontend/chat-plugin/lib/src/global.d.ts | 2 + .../chat-plugin/lib/src/websocket/index.ts | 10 +- .../pages/Inbox/MessageInput/InputOptions.tsx | 7 +- .../ui/src/pages/Inbox/MessageInput/index.tsx | 12 +- .../Messenger/MessengerContainer/index.tsx | 6 +- .../images/icons/paperclipChatplugin.svg | 43 ++++++ .../providers/chatplugin/ChatPluginRender.tsx | 24 ++++ .../providers/chatplugin/chatPluginModel.ts | 40 +++++- .../render/providers/twilio/TwilioRender.tsx | 2 - .../render/services/mediaAttachments.ts | 33 ++++- 19 files changed, 646 insertions(+), 110 deletions(-) create mode 100644 frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.module.scss create mode 100644 frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.tsx create mode 100644 frontend/chat-plugin/lib/src/components/dragAndDrop/index.module.scss create mode 100644 frontend/chat-plugin/lib/src/components/dragAndDrop/index.tsx create mode 100644 frontend/chat-plugin/lib/src/global.d.ts create mode 100644 lib/typescript/assets/images/icons/paperclipChatplugin.svg diff --git a/frontend/chat-plugin/dev/config.ts b/frontend/chat-plugin/dev/config.ts index ca6c8921d7..72c836c59e 100644 --- a/frontend/chat-plugin/dev/config.ts +++ b/frontend/chat-plugin/dev/config.ts @@ -29,8 +29,4 @@ export const config: Config = { }, }, showMode: false, - inboundMessageColor: '#B8E986', - inboundMessageTextColor: '#BD10E0', - outboundMessageColor: '#7ED321', - outboundMessageTextColor: '#F8E71C', }; diff --git a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.module.scss b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.module.scss new file mode 100644 index 0000000000..40579179e7 --- /dev/null +++ b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.module.scss @@ -0,0 +1,46 @@ +@import 'assets/scss/colors.scss'; + +.container { + max-width: 550px; + position: relative; + margin: 0px 0px 5px 10px; + animation: fadeIn 3s linear forwards; +} + +@keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +.removeButton { + position: absolute; + right: 5px; + top: 7px; + padding: 8px; + margin: 0; + line-height: 0; + border-radius: 50%; + border: 1px solid var(--color-light-gray); + background-color: var(--color-template-highlight); + cursor: pointer; + outline: none; + z-index: 1; + + svg { + height: 10px; + width: 10px; + } +} + +.removeButton:after { + content: ''; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} diff --git a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.tsx b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.tsx new file mode 100644 index 0000000000..4c8dad1e68 --- /dev/null +++ b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/InputSelector/index.tsx @@ -0,0 +1,84 @@ +import React, {useRef, useEffect, useState} from 'react'; +import styles from './index.module.scss'; +import {ReactComponent as Close} from 'assets/images/icons/close.svg'; +import {SourceMessage} from 'render'; +import {Message} from 'model'; + +type InputSelectorProps = { + message: Message; + removeElementFromInput?: () => void; + contentResizedHeight?: number; +}; + +const textareaHeight = 40; +const minImageHeight = 50; + +export const InputSelector = (props: InputSelectorProps) => { + const {message, removeElementFromInput, contentResizedHeight} = props; + const [closeIconWidth, setCloseIconWidth] = useState(''); + const [closeIconHeight, setCloseIconHeight] = useState(''); + const [selectorPreviewCloseButton, setSelectorPreviewCloseButton] = useState(false); + + const fileSelectorDiv = useRef(null); + const removeFileButton = useRef(null); + + const resizeObserver = new ResizeObserver(entries => { + for (const entry of entries) { + const fileSelectorHeight = entry.contentRect.height; + const fileSelectorWidth = entry.contentRect.width; + + if (fileSelectorHeight > contentResizedHeight) { + scaleDownInputSelector(fileSelectorHeight); + } else if (fileSelectorHeight >= textareaHeight && fileSelectorWidth > minImageHeight) { + setSelectorPreviewCloseButton(true); + } + } + }); + + useEffect(() => { + resizeObserver.observe(fileSelectorDiv?.current); + }, [fileSelectorDiv?.current]); + + const scaleDownInputSelector = (fileSelectorHeight: number) => { + const scaleRatio = Number(Math.min(contentResizedHeight / fileSelectorHeight).toFixed(2)); + let iconSize = '24px'; + let buttonSize = '48px'; + + if (scaleRatio <= 0.9) { + if (scaleRatio < 0.5) { + iconSize = scaleRatio > 0.3 ? '24px' : '60px'; + buttonSize = scaleRatio > 0.3 ? '48px' : '120px'; + } else { + iconSize = '18px'; + buttonSize = '36px'; + } + + setCloseIconHeight(iconSize); + setCloseIconWidth(iconSize); + + if (removeFileButton && removeFileButton.current) { + removeFileButton.current.style.width = buttonSize; + removeFileButton.current.style.height = buttonSize; + } + } + + fileSelectorDiv.current.style.transform = `scale(${scaleRatio})`; + setSelectorPreviewCloseButton(true); + }; + + return ( +
+ {selectorPreviewCloseButton && ( + + )} + +
+ ); +}; diff --git a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.module.scss b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.module.scss index ad1257e581..e17a01a048 100644 --- a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.module.scss +++ b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.module.scss @@ -3,11 +3,13 @@ .inputBar { display: flex; - justify-content: space-between; + justify-content: flex-end; align-items: center; padding: 8px 0; margin: 0 8px; border-top: 1px solid var(--color-template-gray); + max-height: 100px; + min-height: 42px; } .textArea { @@ -144,7 +146,6 @@ align-items: center; position: relative; height: 30px; - margin-right: 4px; background: transparent; border: none; cursor: pointer; @@ -175,11 +176,27 @@ } } +.iconContainer { + display: flex; + flex-direction: row; + margin-right: 8px; +} + .smileyIcon { height: 20px; width: 20px; } +.paperclipIcon { + height: 24px; + width: 24px; + + svg { + height: 24px; + width: 24px; + } +} + .iconButton:hover { background-color: var(--color-background-blue); border-radius: 50%; @@ -194,3 +211,20 @@ display: block; } } + +.fileInput { + display: none; +} + +.selectorLoader { + position: absolute; + left: 25px; + display: flex; + justify-content: center; + align-items: center; +} + +.selectorLoader span { + @include font-base; + color: var(--color-text-gray); +} diff --git a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx index 9e95710698..91cfe095f8 100644 --- a/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx +++ b/frontend/chat-plugin/lib/src/airyRenderProps/AiryInputBar/index.tsx @@ -6,14 +6,21 @@ import {useTranslation} from 'react-i18next'; import {ReactComponent as AiryIcon} from 'assets/images/icons/airy-icon.svg'; import style from './index.module.scss'; import {ReactComponent as Smiley} from 'assets/images/icons/smiley.svg'; +import {ReactComponent as PaperClip} from 'assets/images/icons/paperclipChatplugin.svg'; import {ReactComponent as Paperplane} from 'assets/images/icons/paperplane.svg'; +import {getAttachmentType, getOutboundMapper} from 'render'; +import {InputSelector} from './InputSelector'; +import {uploadMedia} from '../../api'; +import {SimpleLoader} from 'components'; type AiryInputBarProps = { sendMessage: (text: string) => void; + sendMedia: (fileType: string, mediaUrl: string) => void; messageString: string; setMessageString: (text: string) => void; config?: Config; setNewConversation: React.Dispatch>; + dragDropFile: File; }; const AiryInputBar = (props: AiryInputBarProps) => { @@ -21,7 +28,13 @@ const AiryInputBar = (props: AiryInputBarProps) => { const {t} = useTranslation(); const [isShowingEmojiDrawer, setIsShowingEmojiDrawer] = useState(false); + const [uploadedFileUrl, setUploadedFileUrl] = useState(null); + const [loadingFile, setLoadingFile] = useState(false); + const [mediaType, setMediaType] = useState(null); const emojiDiv = useRef(null); + const fileRef = useRef(null); + const outboundMapper: any = getOutboundMapper('chatplugin'); + const contentResizedHeight = 100; const textInputRef = createRef(); const dataCyButtonId = cyInputbarButton; @@ -33,6 +46,10 @@ const AiryInputBar = (props: AiryInputBarProps) => { textInputRef.current.selectionEnd = props.messageString?.length ?? 0; }, []); + useEffect(() => { + props.dragDropFile && uploadFile(props.dragDropFile); + }, [props.dragDropFile]); + const resizeTextarea = () => { const textArea = textInputRef.current; if (textArea) { @@ -50,6 +67,11 @@ const AiryInputBar = (props: AiryInputBarProps) => { props.setMessageString(''); props.sendMessage(props.messageString); } + + if (uploadedFileUrl) { + props.sendMedia(mediaType, uploadedFileUrl); + setUploadedFileUrl(null); + } }; const handleChange = (event: ChangeEvent) => { @@ -69,6 +91,21 @@ const AiryInputBar = (props: AiryInputBarProps) => { } }; + const removeElementFromInput = () => { + setUploadedFileUrl(null); + }; + + const uploadFile = (file: File) => { + const fileType = getAttachmentType(file.name, 'chatplugin'); + setMediaType(fileType); + setLoadingFile(true); + uploadMedia(file).then((mediaUrl: string) => { + setUploadedFileUrl(mediaUrl); + props.setMessageString(''); + setLoadingFile(false); + }); + }; + const InputOptions = () => { const handleEmojiDrawer = () => { if (isShowingEmojiDrawer) { @@ -114,19 +151,46 @@ const AiryInputBar = (props: AiryInputBarProps) => { handleEmojiDrawer(); }; + const openFileSelector = () => { + fileRef.current.click(); + }; + + const selectedFile = (event: React.ChangeEvent) => { + if (uploadedFileUrl) setUploadedFileUrl(null); + const file = event.target.files[0]; + uploadFile(file); + }; + return ( -
- <> - {isShowingEmojiDrawer && ( -
- -
- )} - - +
+ {isShowingEmojiDrawer && ( +
+ +
+ )} + {!uploadedFileUrl && ( +
+ + + + +
+ )}
); }; @@ -134,17 +198,39 @@ const AiryInputBar = (props: AiryInputBarProps) => { return ( <> {!(config.hideInputBar === true) && ( -
-