From 18ee5343aa45440538029ae2a2311e9131ad006a Mon Sep 17 00:00:00 2001 From: Elad Ossadon Date: Thu, 10 Dec 2020 11:16:31 -0800 Subject: [PATCH 1/3] Sync date format from settings with clientConfig (#5299) --- .../pages/settings/OrganizationSettings.jsx | 2 +- .../GeneralSettings/FormatSettings.jsx | 4 +- .../settings/hooks/useOrganizationSettings.js | 6 + client/app/services/auth.js | 4 + .../settings/organization_settings_spec.js | 32 +- client/cypress/support/commands.js | 2 + client/cypress/tsconfig.json | 2 +- package-lock.json | 308 ++++++++++++++++++ package.json | 1 + 9 files changed, 357 insertions(+), 4 deletions(-) diff --git a/client/app/pages/settings/OrganizationSettings.jsx b/client/app/pages/settings/OrganizationSettings.jsx index bc1e5c82bb..3228b80cba 100644 --- a/client/app/pages/settings/OrganizationSettings.jsx +++ b/client/app/pages/settings/OrganizationSettings.jsx @@ -26,7 +26,7 @@ function OrganizationSettings({ onError }) { {isLoading ? ( ) : ( - )} diff --git a/client/app/pages/settings/components/GeneralSettings/FormatSettings.jsx b/client/app/pages/settings/components/GeneralSettings/FormatSettings.jsx index 80c8b30834..f1c6cf2646 100644 --- a/client/app/pages/settings/components/GeneralSettings/FormatSettings.jsx +++ b/client/app/pages/settings/components/GeneralSettings/FormatSettings.jsx @@ -20,7 +20,9 @@ export default function FormatSettings(props) { onChange={value => onChange({ date_format: value })} data-test="DateFormatSelect"> {clientConfig.dateFormatList.map(dateFormat => ( - {dateFormat} + + {dateFormat} + ))} )} diff --git a/client/app/pages/settings/hooks/useOrganizationSettings.js b/client/app/pages/settings/hooks/useOrganizationSettings.js index 6ad3d038c4..d0f72a9aca 100644 --- a/client/app/pages/settings/hooks/useOrganizationSettings.js +++ b/client/app/pages/settings/hooks/useOrganizationSettings.js @@ -3,6 +3,7 @@ import { useState, useEffect, useCallback } from "react"; import recordEvent from "@/services/recordEvent"; import OrgSettings from "@/services/organizationSettings"; import useImmutableCallback from "@/lib/hooks/useImmutableCallback"; +import { updateClientConfig } from "@/services/auth"; export default function useOrganizationSettings({ onError }) { const [settings, setSettings] = useState({}); @@ -49,6 +50,11 @@ export default function useOrganizationSettings({ onError }) { const settings = get(response, "settings"); setSettings(settings); setCurrentValues({ ...settings }); + updateClientConfig({ + dateFormat: currentValues.date_format, + timeFormat: currentValues.time_format, + dateTimeFormat: `${currentValues.date_format} ${currentValues.time_format}`, + }); }) .catch(handleError) .finally(() => setIsSaving(false)); diff --git a/client/app/services/auth.js b/client/app/services/auth.js index 999ebb27a1..467e5664ae 100644 --- a/client/app/services/auth.js +++ b/client/app/services/auth.js @@ -44,6 +44,10 @@ const AuthUrls = { Login: "login", }; +export function updateClientConfig(newClientConfig) { + extend(clientConfig, newClientConfig); +} + function updateSession(sessionData) { logger("Updating session to be:", sessionData); extend(session, sessionData, { loaded: true }); diff --git a/client/cypress/integration/settings/organization_settings_spec.js b/client/cypress/integration/settings/organization_settings_spec.js index 85d884634a..8318d7028b 100644 --- a/client/cypress/integration/settings/organization_settings_spec.js +++ b/client/cypress/integration/settings/organization_settings_spec.js @@ -6,10 +6,40 @@ describe("Settings", () => { it("renders the page and takes a screenshot", () => { cy.getByTestId("OrganizationSettings").within(() => { - cy.getByTestId("DateFormatSelect").should("contain", "DD/MM/YY"); cy.getByTestId("TimeFormatSelect").should("contain", "HH:mm"); }); cy.percySnapshot("Organization Settings"); }); + + it("can set date format setting", () => { + cy.getByTestId("DateFormatSelect").click(); + cy.getByTestId("DateFormatSelect:YYYY-MM-DD").click(); + cy.getByTestId("OrganizationSettingsSaveButton").click(); + + cy.createQuery({ + name: "test date format", + query: "SELECT NOW()", + }).then(({ id: queryId }) => { + cy.visit(`/queries/${queryId}`); + cy.findByText("Refresh Now").click(); + + // "created at" field is formatted with the date format. + cy.getByTestId("TableVisualization") + .findAllByText(/\d{4}-\d{2}-\d{2}/) + .should("exist"); + + // set to a different format and expect a different result in the table + cy.visit("/settings/general"); + cy.getByTestId("DateFormatSelect").click(); + cy.getByTestId("DateFormatSelect:MM/DD/YY").click(); + cy.getByTestId("OrganizationSettingsSaveButton").click(); + + cy.visit(`/queries/${queryId}`); + + cy.getByTestId("TableVisualization") + .findAllByText(/\d{2}\/\d{2}\/\d{2}/) + .should("exist"); + }); + }); }); diff --git a/client/cypress/support/commands.js b/client/cypress/support/commands.js index 4859b855cc..675b58f033 100644 --- a/client/cypress/support/commands.js +++ b/client/cypress/support/commands.js @@ -2,6 +2,8 @@ import "@percy/cypress"; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved +import "@testing-library/cypress/add-commands"; + const { each } = Cypress._; Cypress.Commands.add("login", (email = "admin@redash.io", password = "password") => { diff --git a/client/cypress/tsconfig.json b/client/cypress/tsconfig.json index 0bf2f53bcf..d4c0b515ba 100644 --- a/client/cypress/tsconfig.json +++ b/client/cypress/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["cypress","@percy/cypress","@testing-library/cypress"] + "types": ["cypress", "@percy/cypress", "@testing-library/cypress"] }, "include": ["./**/*.ts"] } diff --git a/package-lock.json b/package-lock.json index 55c15b5bf0..76d06ddce3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3982,6 +3982,64 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "@mapbox/geojson-area": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz", @@ -4988,6 +5046,199 @@ "any-observable": "^0.3.0" } }, + "@testing-library/cypress": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-7.0.2.tgz", + "integrity": "sha512-avBCbcCMPFHvWg4BBCA/pIh3MCwcKoJ+rc3XyZdKC5mFYPV7edjW3s4KZx/x3klXuttyuM/UesRhbSj4l5aQbw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^7.26.6" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + } + } + }, + "@testing-library/dom": { + "version": "7.28.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.28.1.tgz", + "integrity": "sha512-acv3l6kDwZkQif/YqJjstT3ks5aaI33uxGNVIQmdKzbZ2eMKgg3EV2tB84GDdc72k3Kjhl6mO8yUt6StVIdRDg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^4.2.0", + "aria-query": "^4.2.2", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.4", + "lz-string": "^1.4.4", + "pretty-format": "^26.6.2" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/runtime-corejs3": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz", + "integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + } + } + }, + "react-is": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + } + } + }, "@turf/area": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.0.1.tgz", @@ -5028,6 +5279,12 @@ "@turf/helpers": "6.x" } }, + "@types/aria-query": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.0.tgz", + "integrity": "sha512-iIgQNzCm0v7QMhhe4Jjn9uRh+I6GoPmt03CbEtwx3ao8/EfoQcmgtqH4vQ5Db/lxiIGaWDv6nwvunuh0RyX0+A==", + "dev": true + }, "@types/classnames": { "version": "2.2.10", "resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.2.10.tgz", @@ -5066,6 +5323,30 @@ "hoist-non-react-statics": "^3.3.0" } }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, "@types/json-schema": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.3.tgz", @@ -5139,6 +5420,21 @@ "integrity": "sha512-Xh9kEOaKWhm3vYD5lUjYFFiSfpN4y3/iQCJUAVwFaQ1rVvHs4WXTa5C8E7gyF3kxwsMS8KgttW7WBAPtFlsvAg==", "dev": true }, + "@types/yargs": { + "version": "15.0.11", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.11.tgz", + "integrity": "sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.10.0.tgz", @@ -9999,6 +10295,12 @@ "esutils": "^2.0.2" } }, + "dom-accessibility-api": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz", + "integrity": "sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ==", + "dev": true + }, "dom-align": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/dom-align/-/dom-align-1.12.0.tgz", @@ -16992,6 +17294,12 @@ "yallist": "^2.1.2" } }, + "lz-string": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=", + "dev": true + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", diff --git a/package.json b/package.json index 3197896ef4..9a703c51aa 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "@percy/agent": "0.24.3", "@percy/cypress": "^2.3.2", "@pmmmwh/react-refresh-webpack-plugin": "^0.4.3", + "@testing-library/cypress": "^7.0.2", "@types/classnames": "^2.2.10", "@types/hoist-non-react-statics": "^3.3.1", "@types/lodash": "^4.14.157", From b70e95a3235090959138a21cda1d17415fd32152 Mon Sep 17 00:00:00 2001 From: Rafael Wendel Date: Mon, 14 Dec 2020 10:09:43 -0300 Subject: [PATCH 2/3] added eslint no-console (#5305) * added eslint no-console * Update client/.eslintrc.js to allow warnings Co-authored-by: Gabriel Dutra Co-authored-by: Gabriel Dutra --- client/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/.eslintrc.js b/client/.eslintrc.js index c0e54dcb7f..45644f6d19 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -20,6 +20,7 @@ module.exports = { // allow debugger during development "no-debugger": process.env.NODE_ENV === "production" ? 2 : 0, "jsx-a11y/anchor-is-valid": "off", + "no-console": ["warn", { allow: ["warn", "error"] }], "no-restricted-imports": [ "error", { From c290864ccd9d038e0d4558ef4e0ba67f29baa3ed Mon Sep 17 00:00:00 2001 From: Elad Ossadon Date: Tue, 15 Dec 2020 18:21:37 -0800 Subject: [PATCH 3/3] Convert viz-lib to TypeScript (#5310) Co-authored-by: ts-migrate <> --- .../ApplicationArea/routeWithUserSession.tsx | 4 +- client/tsconfig.json | 17 +- package-lock.json | 28 +- package.json | 6 +- viz-lib/.babelrc | 2 +- viz-lib/jsconfig.json | 9 - viz-lib/package-lock.json | 2237 ++++++++++++++++- viz-lib/package.json | 23 +- .../ColorPicker/{Input.jsx => Input.tsx} | 33 +- .../ColorPicker/{Label.jsx => Label.tsx} | 23 +- .../ColorPicker/{Swatch.jsx => Swatch.tsx} | 23 +- .../ColorPicker/{index.jsx => index.tsx} | 71 +- .../ColorPicker/{utils.js => utils.ts} | 4 +- .../{ErrorBoundary.jsx => ErrorBoundary.tsx} | 39 +- .../{HtmlContent.jsx => HtmlContent.tsx} | 3 + .../{index.jsx => index.tsx} | 14 +- ...nteractive.jsx => JsonViewInteractive.tsx} | 26 +- .../sortable/{index.jsx => index.tsx} | 38 +- .../{ContextHelp.jsx => ContextHelp.tsx} | 16 +- .../editor/{Section.jsx => Section.tsx} | 31 +- .../editor/{Switch.jsx => Switch.tsx} | 18 +- .../editor/{TextArea.jsx => TextArea.tsx} | 5 +- .../editor/createTabbedEditor.jsx | 56 - .../editor/createTabbedEditor.tsx | 57 + .../editor/{index.js => index.ts} | 0 ...hControlLabel.jsx => withControlLabel.tsx} | 35 +- viz-lib/src/{index.js => index.ts} | 0 ...und.js => chooseTextColorForBackground.ts} | 2 +- ...epCompare.js => useMemoWithDeepCompare.ts} | 3 +- viz-lib/src/lib/referenceCountingCache.js | 39 - viz-lib/src/lib/referenceCountingCache.ts | 46 + viz-lib/src/lib/{utils.js => utils.ts} | 6 +- .../{value-format.jsx => value-format.tsx} | 30 +- .../{resizeObserver.js => resizeObserver.ts} | 2 +- .../src/services/{sanitize.js => sanitize.ts} | 0 .../{ColorPalette.js => ColorPalette.ts} | 0 .../visualizations/{Editor.jsx => Editor.tsx} | 17 +- .../{Renderer.jsx => Renderer.tsx} | 31 +- .../box-plot/{Editor.jsx => Editor.tsx} | 15 +- .../box-plot/{Renderer.jsx => Renderer.tsx} | 28 +- .../box-plot/{d3box.js => d3box.ts} | 40 +- .../box-plot/{index.js => index.ts} | 4 +- .../chart/Editor/AxisSettings.jsx | 110 - .../chart/Editor/AxisSettings.tsx | 125 + ...hartTypeSelect.jsx => ChartTypeSelect.tsx} | 15 +- ...ttings.test.js => ColorsSettings.test.tsx} | 6 +- ...{ColorsSettings.jsx => ColorsSettings.tsx} | 6 +- ...pingSelect.jsx => ColumnMappingSelect.tsx} | 25 +- .../chart/Editor/CustomChartSettings.jsx | 48 - .../chart/Editor/CustomChartSettings.tsx | 63 + ...gs.test.js => DataLabelsSettings.test.tsx} | 4 +- ...elsSettings.jsx => DataLabelsSettings.tsx} | 19 +- ...Settings.jsx => DefaultColorsSettings.tsx} | 18 +- ...tings.test.js => GeneralSettings.test.tsx} | 9 +- ...eneralSettings.jsx => GeneralSettings.tsx} | 81 +- ...Settings.jsx => HeatmapColorsSettings.tsx} | 18 +- ...lorsSettings.jsx => PieColorsSettings.tsx} | 20 +- ...ttings.test.js => SeriesSettings.test.tsx} | 4 +- ...{SeriesSettings.jsx => SeriesSettings.tsx} | 24 +- .../chart/Editor/XAxisSettings.jsx | 47 - ...ettings.test.js => XAxisSettings.test.tsx} | 4 +- .../chart/Editor/XAxisSettings.tsx | 66 + .../chart/Editor/YAxisSettings.jsx | 75 - ...ettings.test.js => YAxisSettings.test.tsx} | 8 +- .../chart/Editor/YAxisSettings.tsx | 102 + ...t.js.snap => ColorsSettings.test.tsx.snap} | 0 ....snap => DataLabelsSettings.test.tsx.snap} | 0 ....js.snap => GeneralSettings.test.tsx.snap} | 0 ...t.js.snap => SeriesSettings.test.tsx.snap} | 0 ...st.js.snap => XAxisSettings.test.tsx.snap} | 0 ...st.js.snap => YAxisSettings.test.tsx.snap} | 0 .../Editor/{index.test.js => index.test.tsx} | 6 +- .../chart/Editor/{index.jsx => index.tsx} | 32 +- ...mPlotlyChart.jsx => CustomPlotlyChart.tsx} | 8 +- .../chart/Renderer/PlotlyChart.d.ts | 10 - .../{PlotlyChart.jsx => PlotlyChart.tsx} | 20 +- .../chart/Renderer/{index.jsx => index.tsx} | 5 +- .../Renderer/{initChart.js => initChart.ts} | 24 +- ...ChartData.test.js => getChartData.test.ts} | 0 .../{getChartData.js => getChartData.ts} | 20 +- .../chart/{getOptions.js => getOptions.ts} | 2 +- .../chart/{index.js => index.ts} | 0 ...ustomChartUtils.js => customChartUtils.ts} | 13 +- .../src/visualizations/chart/plotly/index.js | 29 - .../src/visualizations/chart/plotly/index.ts | 36 + ...repareData.test.js => prepareData.test.ts} | 7 +- .../plotly/{prepareData.js => prepareData.ts} | 3 +- ...reDefaultData.js => prepareDefaultData.ts} | 36 +- ...reHeatmapData.js => prepareHeatmapData.ts} | 10 +- ...reLayout.test.js => prepareLayout.test.ts} | 0 .../{prepareLayout.js => prepareLayout.ts} | 23 +- .../{preparePieData.js => preparePieData.ts} | 17 +- .../plotly/{updateAxes.js => updateAxes.ts} | 19 +- ...{updateChartSize.js => updateChartSize.ts} | 12 +- .../plotly/{updateData.js => updateData.ts} | 45 +- .../chart/plotly/{utils.js => utils.ts} | 7 +- .../{ColorPalette.js => ColorPalette.ts} | 0 ...{BoundsSettings.jsx => BoundsSettings.tsx} | 19 +- ...{ColorsSettings.jsx => ColorsSettings.tsx} | 37 +- ...{FormatSettings.jsx => FormatSettings.tsx} | 46 +- ...eneralSettings.jsx => GeneralSettings.tsx} | 23 +- .../choropleth/Editor/{index.js => index.ts} | 0 .../visualizations/choropleth/Editor/utils.js | 28 - .../visualizations/choropleth/Editor/utils.ts | 34 + .../Renderer/{Legend.jsx => Legend.tsx} | 24 +- .../Renderer/{index.jsx => index.tsx} | 15 +- .../{initChoropleth.js => initChoropleth.tsx} | 30 +- .../Renderer/{utils.js => utils.ts} | 19 +- .../{getOptions.js => getOptions.ts} | 3 +- .../{useLoadGeoJson.js => useLoadGeoJson.ts} | 7 +- .../choropleth/{index.js => index.ts} | 0 ...rt-projection.js => convert-projection.ts} | 13 +- .../cohort/{Cornelius.jsx => Cornelius.tsx} | 90 +- ...nceSettings.jsx => AppearanceSettings.tsx} | 26 +- ...{ColorsSettings.jsx => ColorsSettings.tsx} | 18 +- .../cohort/Editor/ColumnsSettings.jsx | 72 - .../cohort/Editor/ColumnsSettings.tsx | 88 + ...ptionsSettings.jsx => OptionsSettings.tsx} | 15 +- .../cohort/Editor/{index.js => index.ts} | 0 .../cohort/{Renderer.jsx => Renderer.tsx} | 5 +- .../cohort/{getOptions.js => getOptions.ts} | 2 +- .../cohort/{index.js => index.ts} | 0 .../cohort/{prepareData.js => prepareData.ts} | 30 +- .../counter/Editor/FormatSettings.jsx | 78 - .../counter/Editor/FormatSettings.tsx | 92 + .../counter/Editor/GeneralSettings.jsx | 85 - .../counter/Editor/GeneralSettings.tsx | 105 + .../counter/Editor/{index.js => index.ts} | 0 .../counter/{Renderer.jsx => Renderer.tsx} | 18 +- .../counter/{index.js => index.ts} | 5 +- .../counter/{utils.test.js => utils.test.ts} | 2 +- .../counter/{utils.js => utils.ts} | 34 +- ...etailsRenderer.jsx => DetailsRenderer.tsx} | 9 +- .../details/{index.js => index.ts} | 5 +- ...nceSettings.jsx => AppearanceSettings.tsx} | 20 +- .../funnel/Editor/GeneralSettings.jsx | 116 - .../funnel/Editor/GeneralSettings.tsx | 137 + .../funnel/Editor/{index.js => index.ts} | 0 .../Renderer/{FunnelBar.jsx => FunnelBar.tsx} | 21 +- .../funnel/Renderer/{index.jsx => index.tsx} | 31 +- .../{prepareData.js => prepareData.ts} | 7 +- .../funnel/{getOptions.js => getOptions.ts} | 4 +- .../funnel/{index.js => index.ts} | 0 .../src/visualizations/{index.js => index.ts} | 0 ...{FormatSettings.jsx => FormatSettings.tsx} | 14 +- ...eneralSettings.jsx => GeneralSettings.tsx} | 23 +- ...{GroupsSettings.jsx => GroupsSettings.tsx} | 17 +- .../{StyleSettings.jsx => StyleSettings.tsx} | 47 +- .../map/Editor/{index.js => index.ts} | 0 .../map/{Renderer.jsx => Renderer.tsx} | 16 +- .../map/{getOptions.js => getOptions.ts} | 2 +- .../visualizations/map/{index.js => index.ts} | 0 .../map/{initMap.js => initMap.ts} | 39 +- .../map/{prepareData.js => prepareData.ts} | 3 +- viz-lib/src/visualizations/pivot/Editor.jsx | 42 - viz-lib/src/visualizations/pivot/Editor.tsx | 61 + .../pivot/{Renderer.jsx => Renderer.tsx} | 14 +- .../pivot/{index.js => index.ts} | 2 +- viz-lib/src/visualizations/prop-types.js | 31 - viz-lib/src/visualizations/prop-types.ts | 46 + ...zations.js => registeredVisualizations.ts} | 58 +- .../sankey/{Editor.jsx => Editor.tsx} | 0 .../sankey/{Renderer.jsx => Renderer.tsx} | 5 +- .../sankey/{d3sankey.js => d3sankey.ts} | 93 +- .../sankey/{index.js => index.ts} | 4 +- .../sankey/{initSankey.js => initSankey.ts} | 67 +- .../sunburst/{Editor.jsx => Editor.tsx} | 2 + .../sunburst/{Renderer.jsx => Renderer.tsx} | 5 +- .../sunburst/{index.js => index.ts} | 4 +- .../{initSunburst.js => initSunburst.ts} | 66 +- .../table/Editor/ColumnEditor.jsx | 89 - .../table/Editor/ColumnEditor.tsx | 100 + ...tings.test.js => ColumnsSettings.test.tsx} | 4 +- ...olumnsSettings.jsx => ColumnsSettings.tsx} | 17 +- ...Settings.test.js => GridSettings.test.tsx} | 4 +- .../{GridSettings.jsx => GridSettings.tsx} | 10 +- ....js.snap => ColumnsSettings.test.tsx.snap} | 0 ...est.js.snap => GridSettings.test.tsx.snap} | 0 .../table/Editor/{index.jsx => index.tsx} | 0 .../table/{Renderer.jsx => Renderer.tsx} | 38 +- ...ean.test.js.snap => boolean.test.tsx.snap} | 0 ...me.test.js.snap => datetime.test.tsx.snap} | 0 ...image.test.js.snap => image.test.tsx.snap} | 0 .../{link.test.js.snap => link.test.tsx.snap} | 0 ...mber.test.js.snap => number.test.tsx.snap} | 0 .../{text.test.js.snap => text.test.tsx.snap} | 0 .../{boolean.test.js => boolean.test.tsx} | 5 +- .../columns/{boolean.jsx => boolean.tsx} | 38 +- .../{datetime.test.js => datetime.test.tsx} | 5 +- .../columns/{datetime.jsx => datetime.tsx} | 30 +- .../columns/{image.test.js => image.test.tsx} | 5 +- .../table/columns/{image.jsx => image.tsx} | 56 +- .../table/columns/{index.js => index.ts} | 0 .../table/columns/{json.jsx => json.tsx} | 8 +- .../columns/{link.test.js => link.test.tsx} | 5 +- .../table/columns/{link.jsx => link.tsx} | 49 +- .../{number.test.js => number.test.tsx} | 5 +- .../table/columns/{number.jsx => number.tsx} | 30 +- .../columns/{text.test.js => text.test.tsx} | 5 +- .../table/columns/{text.jsx => text.tsx} | 31 +- .../table/{getOptions.js => getOptions.ts} | 20 +- .../table/{index.js => index.ts} | 0 .../table/{utils.js => utils.tsx} | 38 +- ...Settings.js => visualizationsSettings.tsx} | 21 +- .../src/visualizations/word-cloud/Editor.jsx | 95 - .../src/visualizations/word-cloud/Editor.tsx | 113 + .../word-cloud/{Renderer.jsx => Renderer.tsx} | 44 +- .../word-cloud/{index.js => index.ts} | 2 +- viz-lib/tsconfig.json | 22 + viz-lib/webpack.config.js | 6 +- 210 files changed, 5289 insertions(+), 2042 deletions(-) delete mode 100644 viz-lib/jsconfig.json rename viz-lib/src/components/ColorPicker/{Input.jsx => Input.tsx} (79%) rename viz-lib/src/components/ColorPicker/{Label.jsx => Label.tsx} (61%) rename viz-lib/src/components/ColorPicker/{Swatch.jsx => Swatch.tsx} (60%) rename viz-lib/src/components/ColorPicker/{index.jsx => index.tsx} (61%) rename viz-lib/src/components/ColorPicker/{utils.js => utils.ts} (71%) rename viz-lib/src/components/{ErrorBoundary.jsx => ErrorBoundary.tsx} (51%) rename viz-lib/src/components/{HtmlContent.jsx => HtmlContent.tsx} (51%) rename viz-lib/src/components/TextAlignmentSelect/{index.jsx => index.tsx} (87%) rename viz-lib/src/components/json-view-interactive/{JsonViewInteractive.jsx => JsonViewInteractive.tsx} (88%) rename viz-lib/src/components/sortable/{index.jsx => index.tsx} (60%) rename viz-lib/src/components/visualizations/editor/{ContextHelp.jsx => ContextHelp.tsx} (80%) rename viz-lib/src/components/visualizations/editor/{Section.jsx => Section.tsx} (50%) rename viz-lib/src/components/visualizations/editor/{Switch.jsx => Switch.tsx} (76%) rename viz-lib/src/components/visualizations/editor/{TextArea.jsx => TextArea.tsx} (84%) delete mode 100644 viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx create mode 100644 viz-lib/src/components/visualizations/editor/createTabbedEditor.tsx rename viz-lib/src/components/visualizations/editor/{index.js => index.ts} (100%) rename viz-lib/src/components/visualizations/editor/{withControlLabel.jsx => withControlLabel.tsx} (72%) rename viz-lib/src/{index.js => index.ts} (100%) rename viz-lib/src/lib/{chooseTextColorForBackground.js => chooseTextColorForBackground.ts} (85%) rename viz-lib/src/lib/hooks/{useMemoWithDeepCompare.js => useMemoWithDeepCompare.ts} (52%) delete mode 100644 viz-lib/src/lib/referenceCountingCache.js create mode 100644 viz-lib/src/lib/referenceCountingCache.ts rename viz-lib/src/lib/{utils.js => utils.ts} (83%) rename viz-lib/src/lib/{value-format.jsx => value-format.tsx} (75%) rename viz-lib/src/services/{resizeObserver.js => resizeObserver.ts} (92%) rename viz-lib/src/services/{sanitize.js => sanitize.ts} (100%) rename viz-lib/src/visualizations/{ColorPalette.js => ColorPalette.ts} (100%) rename viz-lib/src/visualizations/{Editor.jsx => Editor.tsx} (59%) rename viz-lib/src/visualizations/{Renderer.jsx => Renderer.tsx} (69%) rename viz-lib/src/visualizations/box-plot/{Editor.jsx => Editor.tsx} (54%) rename viz-lib/src/visualizations/box-plot/{Renderer.jsx => Renderer.tsx} (73%) rename viz-lib/src/visualizations/box-plot/{d3box.js => d3box.ts} (78%) rename viz-lib/src/visualizations/box-plot/{index.js => index.ts} (79%) delete mode 100644 viz-lib/src/visualizations/chart/Editor/AxisSettings.jsx create mode 100644 viz-lib/src/visualizations/chart/Editor/AxisSettings.tsx rename viz-lib/src/visualizations/chart/Editor/{ChartTypeSelect.jsx => ChartTypeSelect.tsx} (75%) rename viz-lib/src/visualizations/chart/Editor/{ColorsSettings.test.js => ColorsSettings.test.tsx} (95%) rename viz-lib/src/visualizations/chart/Editor/{ColorsSettings.jsx => ColorsSettings.tsx} (70%) rename viz-lib/src/visualizations/chart/Editor/{ColumnMappingSelect.jsx => ColumnMappingSelect.tsx} (62%) delete mode 100644 viz-lib/src/visualizations/chart/Editor/CustomChartSettings.jsx create mode 100644 viz-lib/src/visualizations/chart/Editor/CustomChartSettings.tsx rename viz-lib/src/visualizations/chart/Editor/{DataLabelsSettings.test.js => DataLabelsSettings.test.tsx} (95%) rename viz-lib/src/visualizations/chart/Editor/{DataLabelsSettings.jsx => DataLabelsSettings.tsx} (70%) rename viz-lib/src/visualizations/chart/Editor/{DefaultColorsSettings.jsx => DefaultColorsSettings.tsx} (55%) rename viz-lib/src/visualizations/chart/Editor/{GeneralSettings.test.js => GeneralSettings.test.tsx} (92%) rename viz-lib/src/visualizations/chart/Editor/{GeneralSettings.jsx => GeneralSettings.tsx} (50%) rename viz-lib/src/visualizations/chart/Editor/{HeatmapColorsSettings.jsx => HeatmapColorsSettings.tsx} (59%) rename viz-lib/src/visualizations/chart/Editor/{PieColorsSettings.jsx => PieColorsSettings.tsx} (58%) rename viz-lib/src/visualizations/chart/Editor/{SeriesSettings.test.js => SeriesSettings.test.tsx} (95%) rename viz-lib/src/visualizations/chart/Editor/{SeriesSettings.jsx => SeriesSettings.tsx} (74%) delete mode 100644 viz-lib/src/visualizations/chart/Editor/XAxisSettings.jsx rename viz-lib/src/visualizations/chart/Editor/{XAxisSettings.test.js => XAxisSettings.test.tsx} (95%) create mode 100644 viz-lib/src/visualizations/chart/Editor/XAxisSettings.tsx delete mode 100644 viz-lib/src/visualizations/chart/Editor/YAxisSettings.jsx rename viz-lib/src/visualizations/chart/Editor/{YAxisSettings.test.js => YAxisSettings.test.tsx} (91%) create mode 100644 viz-lib/src/visualizations/chart/Editor/YAxisSettings.tsx rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{ColorsSettings.test.js.snap => ColorsSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{DataLabelsSettings.test.js.snap => DataLabelsSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{GeneralSettings.test.js.snap => GeneralSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{SeriesSettings.test.js.snap => SeriesSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{XAxisSettings.test.js.snap => XAxisSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/__snapshots__/{YAxisSettings.test.js.snap => YAxisSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/chart/Editor/{index.test.js => index.test.tsx} (93%) rename viz-lib/src/visualizations/chart/Editor/{index.jsx => index.tsx} (53%) rename viz-lib/src/visualizations/chart/Renderer/{CustomPlotlyChart.jsx => CustomPlotlyChart.tsx} (71%) delete mode 100644 viz-lib/src/visualizations/chart/Renderer/PlotlyChart.d.ts rename viz-lib/src/visualizations/chart/Renderer/{PlotlyChart.jsx => PlotlyChart.tsx} (63%) rename viz-lib/src/visualizations/chart/Renderer/{index.jsx => index.tsx} (89%) rename viz-lib/src/visualizations/chart/Renderer/{initChart.js => initChart.ts} (75%) rename viz-lib/src/visualizations/chart/{getChartData.test.js => getChartData.test.ts} (100%) rename viz-lib/src/visualizations/chart/{getChartData.js => getChartData.ts} (54%) rename viz-lib/src/visualizations/chart/{getOptions.js => getOptions.ts} (96%) rename viz-lib/src/visualizations/chart/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/chart/plotly/{customChartUtils.js => customChartUtils.ts} (52%) delete mode 100644 viz-lib/src/visualizations/chart/plotly/index.js create mode 100644 viz-lib/src/visualizations/chart/plotly/index.ts rename viz-lib/src/visualizations/chart/plotly/{prepareData.test.js => prepareData.test.ts} (98%) rename viz-lib/src/visualizations/chart/plotly/{prepareData.js => prepareData.ts} (77%) rename viz-lib/src/visualizations/chart/plotly/{prepareDefaultData.js => prepareDefaultData.ts} (80%) rename viz-lib/src/visualizations/chart/plotly/{prepareHeatmapData.js => prepareHeatmapData.ts} (72%) rename viz-lib/src/visualizations/chart/plotly/{prepareLayout.test.js => prepareLayout.test.ts} (100%) rename viz-lib/src/visualizations/chart/plotly/{prepareLayout.js => prepareLayout.ts} (67%) rename viz-lib/src/visualizations/chart/plotly/{preparePieData.js => preparePieData.ts} (78%) rename viz-lib/src/visualizations/chart/plotly/{updateAxes.js => updateAxes.ts} (69%) rename viz-lib/src/visualizations/chart/plotly/{updateChartSize.js => updateChartSize.ts} (89%) rename viz-lib/src/visualizations/chart/plotly/{updateData.js => updateData.ts} (74%) rename viz-lib/src/visualizations/chart/plotly/{utils.js => utils.ts} (64%) rename viz-lib/src/visualizations/choropleth/{ColorPalette.js => ColorPalette.ts} (100%) rename viz-lib/src/visualizations/choropleth/Editor/{BoundsSettings.jsx => BoundsSettings.tsx} (71%) rename viz-lib/src/visualizations/choropleth/Editor/{ColorsSettings.jsx => ColorsSettings.tsx} (50%) rename viz-lib/src/visualizations/choropleth/Editor/{FormatSettings.jsx => FormatSettings.tsx} (60%) rename viz-lib/src/visualizations/choropleth/Editor/{GeneralSettings.jsx => GeneralSettings.tsx} (61%) rename viz-lib/src/visualizations/choropleth/Editor/{index.js => index.ts} (100%) delete mode 100644 viz-lib/src/visualizations/choropleth/Editor/utils.js create mode 100644 viz-lib/src/visualizations/choropleth/Editor/utils.ts rename viz-lib/src/visualizations/choropleth/Renderer/{Legend.jsx => Legend.tsx} (59%) rename viz-lib/src/visualizations/choropleth/Renderer/{index.jsx => index.tsx} (61%) rename viz-lib/src/visualizations/choropleth/Renderer/{initChoropleth.js => initChoropleth.tsx} (72%) rename viz-lib/src/visualizations/choropleth/Renderer/{utils.js => utils.ts} (68%) rename viz-lib/src/visualizations/choropleth/{getOptions.js => getOptions.ts} (89%) rename viz-lib/src/visualizations/choropleth/hooks/{useLoadGeoJson.js => useLoadGeoJson.ts} (79%) rename viz-lib/src/visualizations/choropleth/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/choropleth/maps/{convert-projection.js => convert-projection.ts} (57%) rename viz-lib/src/visualizations/cohort/{Cornelius.jsx => Cornelius.tsx} (62%) rename viz-lib/src/visualizations/cohort/Editor/{AppearanceSettings.jsx => AppearanceSettings.tsx} (54%) rename viz-lib/src/visualizations/cohort/Editor/{ColorsSettings.jsx => ColorsSettings.tsx} (56%) delete mode 100644 viz-lib/src/visualizations/cohort/Editor/ColumnsSettings.jsx create mode 100644 viz-lib/src/visualizations/cohort/Editor/ColumnsSettings.tsx rename viz-lib/src/visualizations/cohort/Editor/{OptionsSettings.jsx => OptionsSettings.tsx} (51%) rename viz-lib/src/visualizations/cohort/Editor/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/cohort/{Renderer.jsx => Renderer.tsx} (94%) rename viz-lib/src/visualizations/cohort/{getOptions.js => getOptions.ts} (92%) rename viz-lib/src/visualizations/cohort/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/cohort/{prepareData.js => prepareData.ts} (68%) delete mode 100644 viz-lib/src/visualizations/counter/Editor/FormatSettings.jsx create mode 100644 viz-lib/src/visualizations/counter/Editor/FormatSettings.tsx delete mode 100644 viz-lib/src/visualizations/counter/Editor/GeneralSettings.jsx create mode 100644 viz-lib/src/visualizations/counter/Editor/GeneralSettings.tsx rename viz-lib/src/visualizations/counter/Editor/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/counter/{Renderer.jsx => Renderer.tsx} (63%) rename viz-lib/src/visualizations/counter/{index.js => index.ts} (84%) rename viz-lib/src/visualizations/counter/{utils.test.js => utils.test.ts} (99%) rename viz-lib/src/visualizations/counter/{utils.js => utils.ts} (57%) rename viz-lib/src/visualizations/details/{DetailsRenderer.jsx => DetailsRenderer.tsx} (83%) rename viz-lib/src/visualizations/details/{index.js => index.ts} (72%) rename viz-lib/src/visualizations/funnel/Editor/{AppearanceSettings.jsx => AppearanceSettings.tsx} (58%) delete mode 100644 viz-lib/src/visualizations/funnel/Editor/GeneralSettings.jsx create mode 100644 viz-lib/src/visualizations/funnel/Editor/GeneralSettings.tsx rename viz-lib/src/visualizations/funnel/Editor/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/funnel/Renderer/{FunnelBar.jsx => FunnelBar.tsx} (68%) rename viz-lib/src/visualizations/funnel/Renderer/{index.jsx => index.tsx} (71%) rename viz-lib/src/visualizations/funnel/Renderer/{prepareData.js => prepareData.ts} (68%) rename viz-lib/src/visualizations/funnel/{getOptions.js => getOptions.ts} (94%) rename viz-lib/src/visualizations/funnel/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/map/Editor/{FormatSettings.jsx => FormatSettings.tsx} (66%) rename viz-lib/src/visualizations/map/Editor/{GeneralSettings.jsx => GeneralSettings.tsx} (51%) rename viz-lib/src/visualizations/map/Editor/{GroupsSettings.jsx => GroupsSettings.tsx} (58%) rename viz-lib/src/visualizations/map/Editor/{StyleSettings.jsx => StyleSettings.tsx} (59%) rename viz-lib/src/visualizations/map/Editor/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/map/{Renderer.jsx => Renderer.tsx} (62%) rename viz-lib/src/visualizations/map/{getOptions.js => getOptions.ts} (93%) rename viz-lib/src/visualizations/map/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/map/{initMap.js => initMap.ts} (70%) rename viz-lib/src/visualizations/map/{prepareData.js => prepareData.ts} (80%) delete mode 100644 viz-lib/src/visualizations/pivot/Editor.jsx create mode 100644 viz-lib/src/visualizations/pivot/Editor.tsx rename viz-lib/src/visualizations/pivot/{Renderer.jsx => Renderer.tsx} (85%) rename viz-lib/src/visualizations/pivot/{index.js => index.ts} (86%) delete mode 100644 viz-lib/src/visualizations/prop-types.js create mode 100644 viz-lib/src/visualizations/prop-types.ts rename viz-lib/src/visualizations/{registeredVisualizations.js => registeredVisualizations.ts} (53%) rename viz-lib/src/visualizations/sankey/{Editor.jsx => Editor.tsx} (100%) rename viz-lib/src/visualizations/sankey/{Renderer.jsx => Renderer.tsx} (77%) rename viz-lib/src/visualizations/sankey/{d3sankey.js => d3sankey.ts} (62%) rename viz-lib/src/visualizations/sankey/{index.js => index.ts} (74%) rename viz-lib/src/visualizations/sankey/{initSankey.js => initSankey.ts} (64%) rename viz-lib/src/visualizations/sunburst/{Editor.jsx => Editor.tsx} (82%) rename viz-lib/src/visualizations/sunburst/{Renderer.jsx => Renderer.tsx} (77%) rename viz-lib/src/visualizations/sunburst/{index.js => index.ts} (76%) rename viz-lib/src/visualizations/sunburst/{initSunburst.js => initSunburst.ts} (72%) delete mode 100644 viz-lib/src/visualizations/table/Editor/ColumnEditor.jsx create mode 100644 viz-lib/src/visualizations/table/Editor/ColumnEditor.tsx rename viz-lib/src/visualizations/table/Editor/{ColumnsSettings.test.js => ColumnsSettings.test.tsx} (95%) rename viz-lib/src/visualizations/table/Editor/{ColumnsSettings.jsx => ColumnsSettings.tsx} (79%) rename viz-lib/src/visualizations/table/Editor/{GridSettings.test.js => GridSettings.test.tsx} (90%) rename viz-lib/src/visualizations/table/Editor/{GridSettings.jsx => GridSettings.tsx} (53%) rename viz-lib/src/visualizations/table/Editor/__snapshots__/{ColumnsSettings.test.js.snap => ColumnsSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/Editor/__snapshots__/{GridSettings.test.js.snap => GridSettings.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/Editor/{index.jsx => index.tsx} (100%) rename viz-lib/src/visualizations/table/{Renderer.jsx => Renderer.tsx} (65%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{boolean.test.js.snap => boolean.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{datetime.test.js.snap => datetime.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{image.test.js.snap => image.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{link.test.js.snap => link.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{number.test.js.snap => number.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/__snapshots__/{text.test.js.snap => text.test.tsx.snap} (100%) rename viz-lib/src/visualizations/table/columns/{boolean.test.js => boolean.test.tsx} (82%) rename viz-lib/src/visualizations/table/columns/{boolean.jsx => boolean.tsx} (55%) rename viz-lib/src/visualizations/table/columns/{datetime.test.js => datetime.test.tsx} (77%) rename viz-lib/src/visualizations/table/columns/{datetime.jsx => datetime.tsx} (64%) rename viz-lib/src/visualizations/table/columns/{image.test.js => image.test.tsx} (88%) rename viz-lib/src/visualizations/table/columns/{image.jsx => image.tsx} (51%) rename viz-lib/src/visualizations/table/columns/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/table/columns/{json.jsx => json.tsx} (88%) rename viz-lib/src/visualizations/table/columns/{link.test.js => link.test.tsx} (88%) rename viz-lib/src/visualizations/table/columns/{link.jsx => link.tsx} (54%) rename viz-lib/src/visualizations/table/columns/{number.test.js => number.test.tsx} (76%) rename viz-lib/src/visualizations/table/columns/{number.jsx => number.tsx} (64%) rename viz-lib/src/visualizations/table/columns/{text.test.js => text.test.tsx} (82%) rename viz-lib/src/visualizations/table/columns/{text.jsx => text.tsx} (66%) rename viz-lib/src/visualizations/table/{getOptions.js => getOptions.ts} (78%) rename viz-lib/src/visualizations/table/{index.js => index.ts} (100%) rename viz-lib/src/visualizations/table/{utils.js => utils.tsx} (60%) rename viz-lib/src/visualizations/{visualizationsSettings.js => visualizationsSettings.tsx} (75%) delete mode 100644 viz-lib/src/visualizations/word-cloud/Editor.jsx create mode 100644 viz-lib/src/visualizations/word-cloud/Editor.tsx rename viz-lib/src/visualizations/word-cloud/{Renderer.jsx => Renderer.tsx} (68%) rename viz-lib/src/visualizations/word-cloud/{index.js => index.ts} (84%) create mode 100644 viz-lib/tsconfig.json diff --git a/client/app/components/ApplicationArea/routeWithUserSession.tsx b/client/app/components/ApplicationArea/routeWithUserSession.tsx index efc6e5628a..ed943c3b4a 100644 --- a/client/app/components/ApplicationArea/routeWithUserSession.tsx +++ b/client/app/components/ApplicationArea/routeWithUserSession.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from "react"; -// @ts-expect-error (Must be removed after adding @redash/viz typing) import ErrorBoundary, { ErrorBoundaryContext } from "@redash/viz/lib/components/ErrorBoundary"; import { Auth } from "@/services/auth"; import { policy } from "@/services/policy"; @@ -62,9 +61,10 @@ export function UserSessionWrapper

({ bodyClass, currentRoute, render }: UserS return ( + {/* @ts-expect-error FIXME */} }> - {({ handleError }: { handleError: UserSessionWrapperRenderChildrenProps

["onError"] }) => + {({ handleError } /* : { handleError: UserSessionWrapperRenderChildrenProps

["onError"] } FIXME bring back type */) => render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError }) } diff --git a/client/tsconfig.json b/client/tsconfig.json index 20f811a1fd..e8f8852003 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -15,21 +15,14 @@ "jsx": "react", "allowSyntheticDefaultImports": true, "noUnusedLocals": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "forceConsistentCasingInFileNames": true, "baseUrl": "./", "paths": { "@/*": ["./app/*"] - } + }, + "skipLibCheck": true }, - "include": [ - "app/**/*" - ], - "exclude": [ - "dist" - ] + "include": ["app/**/*"], + "exclude": ["dist"] } diff --git a/package-lock.json b/package-lock.json index 76d06ddce3..b2ce133823 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5384,22 +5384,22 @@ "dev": true }, "@types/react": { - "version": "16.9.41", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.41.tgz", - "integrity": "sha512-6cFei7F7L4wwuM+IND/Q2cV1koQUvJ8iSV+Gwn0c3kvABZ691g7sp3hfEQHOUBJtccl1gPi+EyNjMIl9nGA0ug==", + "version": "16.14.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.2.tgz", + "integrity": "sha512-BzzcAlyDxXl2nANlabtT4thtvbbnhee8hMmH/CcJrISDBVcJS1iOsP1f0OAgSdGE0MsY9tqcrb9YoZcOFv9dbQ==", "dev": true, "requires": { "@types/prop-types": "*", - "csstype": "^2.2.0" + "csstype": "^3.0.2" } }, "@types/react-dom": { - "version": "16.9.8", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz", - "integrity": "sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==", + "version": "16.9.10", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.10.tgz", + "integrity": "sha512-ItatOrnXDMAYpv6G8UCk2VhbYVTjZT9aorLtA/OzDN9XJ2GKcfam68jutoAcILdRjsRUO8qb7AmyObF77Q8QFw==", "dev": true, "requires": { - "@types/react": "*" + "@types/react": "^16" } }, "@types/sinonjs__fake-timers": { @@ -9448,9 +9448,9 @@ } }, "csstype": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.11.tgz", - "integrity": "sha512-l8YyEC9NBkSm783PFTvh0FmJy7s5pFKrDp49ZL7zBGX3fWkO+N4EEyan1qqp8cwPLDcD0OSdyY6hAMoxp34JFw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==", "dev": true }, "cubic-hermite": { @@ -25447,9 +25447,9 @@ } }, "typescript": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", - "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz", + "integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 9a703c51aa..24ee34712d 100644 --- a/package.json +++ b/package.json @@ -95,8 +95,8 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/lodash": "^4.14.157", "@types/prop-types": "^15.7.3", - "@types/react": "^16.9.41", - "@types/react-dom": "^16.9.8", + "@types/react": "^16.14.2", + "@types/react-dom": "^16.9.10", "@types/sql-formatter": "^2.3.0", "@typescript-eslint/eslint-plugin": "^2.10.0", "@typescript-eslint/parser": "^2.10.0", @@ -144,7 +144,7 @@ "request": "^2.88.0", "request-cookies": "^1.1.0", "style-loader": "^2.0.0", - "typescript": "^3.9.6", + "typescript": "^4.1.2", "url-loader": "^1.1.2", "webpack": "^4.44.2", "webpack-build-notifier": "^0.1.30", diff --git a/viz-lib/.babelrc b/viz-lib/.babelrc index 43f53f5732..ad10c4591f 100644 --- a/viz-lib/.babelrc +++ b/viz-lib/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["@babel/preset-env", "@babel/preset-react"], + "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], "plugins": [ "@babel/plugin-proposal-class-properties", [ diff --git a/viz-lib/jsconfig.json b/viz-lib/jsconfig.json deleted file mode 100644 index 6b60f37bf0..0000000000 --- a/viz-lib/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./src/*"] - } - }, - "exclude": ["dist", "lib"] -} diff --git a/viz-lib/package-lock.json b/viz-lib/package-lock.json index e9718ffd61..c46799845f 100644 --- a/viz-lib/package-lock.json +++ b/viz-lib/package-lock.json @@ -339,6 +339,12 @@ "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", "dev": true }, + "@babel/helper-validator-option": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz", + "integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==", + "dev": true + }, "@babel/helper-wrap-function": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", @@ -498,6 +504,23 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-flow": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.1.tgz", + "integrity": "sha512-1lBLLmtxrwpm4VKmtVFselI/P3pX+G63fAtUUt6b2Nzgao77KNDwyuRt90Mj2/9pKobtt68FdvjfqohZjg/FCA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + } + } + }, "@babel/plugin-syntax-json-strings": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", @@ -570,6 +593,23 @@ "@babel/helper-plugin-utils": "^7.8.3" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz", + "integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + } + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", @@ -672,6 +712,24 @@ "@babel/helper-plugin-utils": "^7.8.3" } }, + "@babel/plugin-transform-flow-strip-types": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.12.1.tgz", + "integrity": "sha512-8hAtkmsQb36yMmEtk2JZ9JnVyDSnDOdlB+0nEGzIDLuK4yR3JcEjfuFPYkdEPSh8Id+rAMeBEn+X0iVEyho6Hg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-flow": "^7.12.1" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + } + } + }, "@babel/plugin-transform-for-of": { "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz", @@ -918,6 +976,194 @@ "@babel/helper-plugin-utils": "^7.8.3" } }, + "@babel/plugin-transform-typescript": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz", + "integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.12.1", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-typescript": "^7.12.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/generator": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", + "dev": true, + "requires": { + "@babel/types": "^7.12.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", + "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.7" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz", + "integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==", + "dev": true, + "requires": { + "@babel/types": "^7.12.7" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.12.1", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", + "dev": true + }, + "@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "@babel/traverse": { + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz", + "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "@babel/types": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "@babel/plugin-transform-unicode-regex": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", @@ -996,6 +1242,24 @@ "semver": "^5.5.0" } }, + "@babel/preset-flow": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.12.1.tgz", + "integrity": "sha512-UAoyMdioAhM6H99qPoKvpHMzxmNVXno8GYU/7vZmGaHk6/KqfDYL1W0NxszVbJ2EP271b7e6Ox+Vk2A9QsB3Sw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-transform-flow-strip-types": "^7.12.1" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + } + } + }, "@babel/preset-modules": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", @@ -1023,6 +1287,38 @@ "@babel/plugin-transform-react-jsx-source": "^7.9.0" } }, + "@babel/preset-typescript": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.7.tgz", + "integrity": "sha512-nOoIqIqBmHBSEgBXWR4Dv/XBehtIFcw9PqZw6rFYuKrzsZmOQm3PR5siLBnKZFEsDb03IegG8nSjU/iXXXYRmw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-validator-option": "^7.12.1", + "@babel/plugin-transform-typescript": "^7.12.1" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + } + } + }, + "@babel/register": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.12.1.tgz", + "integrity": "sha512-XWcmseMIncOjoydKZnWvWi0/5CUCD+ZYKhRwgYlWOrA8fGZ/FjuLRpqtIhLOVD/fvR1b9DQHtZPn68VvhpYf+Q==", + "dev": true, + "requires": { + "find-cache-dir": "^2.0.0", + "lodash": "^4.17.19", + "make-dir": "^2.1.0", + "pirates": "^4.0.0", + "source-map-support": "^0.5.16" + } + }, "@babel/runtime": { "version": "7.9.2", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", @@ -1112,6 +1408,72 @@ "minimist": "^1.2.0" } }, + "@dsherret/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz", + "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1515,6 +1877,32 @@ "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==" }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@plotly/d3-sankey": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/@plotly/d3-sankey/-/d3-sankey-0.7.2.tgz", @@ -1536,6 +1924,37 @@ "elementary-circuits-directed-graph": "^1.0.4" } }, + "@ts-morph/bootstrap": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@ts-morph/bootstrap/-/bootstrap-0.6.0.tgz", + "integrity": "sha512-ZCrY+57ktsNNe3PFnnS4U98lo95zpl8Rpqhe4NKl1c5lmnOBeBlp168D6bQYH/GCnJpErxrgAgZsSqBSh/Jk7A==", + "dev": true, + "requires": { + "@ts-morph/common": "~0.6.0" + } + }, + "@ts-morph/common": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.6.0.tgz", + "integrity": "sha512-pI35nZz5bs3tL3btSVX2cWkAE8rc80F+Fn4TwSC6bQvn7fgn9IyLXVcAfpG6X6NBY5wN9TkSWXn/QYUkBvR/Fw==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "fast-glob": "^3.2.4", + "fs-extra": "^9.0.1", + "is-negated-glob": "^1.0.0", + "multimatch": "^4.0.0", + "typescript": "~4.0.2" + }, + "dependencies": { + "typescript": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", + "integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", + "dev": true + } + } + }, "@turf/area": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.0.1.tgz", @@ -1598,25 +2017,349 @@ "@babel/types": "^7.0.0" } }, - "@types/babel__template": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", - "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", + "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.11.tgz", + "integrity": "sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/cheerio": { + "version": "0.22.23", + "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.23.tgz", + "integrity": "sha512-QfHLujVMlGqcS/ePSf3Oe5hK3H8wi/yN2JYuxSB1U10VvW1fO3K8C+mURQesFYS1Hn7lspOsTT75SKq/XtydQg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/chroma-js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-2.1.2.tgz", + "integrity": "sha512-fpIsY+9doOvRiBLR0xtubHmGBEVhis2z3CSWcxRDy7L2noKWXkT49c1QiU0RZ2YLc8lHitxu13HTuVItXUdD/g==", + "dev": true + }, + "@types/d3": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-6.2.0.tgz", + "integrity": "sha512-XhQ6sCTu+CrFLqJMsg/uRPZQrt5FlCPjPE/wvsSBYoaOZ9C1chdJSS9+2oR8+Xtk6DKGewa7/UP5icJRwAryEA==", + "dev": true, + "requires": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "@types/d3-array": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-2.8.0.tgz", + "integrity": "sha512-Q0ubcGHAmCRPh90/hoYB4eKWhxYKUxphwSeQrlz2tiabQ8S9zqhaE2CZJtCaLH2cjqKcjr52WPvmOA7ha0O4ZA==", + "dev": true + }, + "@types/d3-axis": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-2.0.0.tgz", + "integrity": "sha512-gUdlEwGBLl3tXGiBnBNmNzph9W3bCfa4tBgWZD60Z1eDQKTY4zyCAcZ3LksignGfKawYatmDYcBdjJ5h/54sqA==", + "dev": true, + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-brush": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-2.1.0.tgz", + "integrity": "sha512-rLQqxQeXWF4ArXi81GlV8HBNwJw9EDpz0jcWvvzv548EDE4tXrayBTOHYi/8Q4FZ/Df8PGXFzxpAVQmJMjOtvQ==", + "dev": true, + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-chord": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-2.0.0.tgz", + "integrity": "sha512-3nHsLY7lImpZlM/hrPeDqqW2a+lRXXoHsG54QSurDGihZAIE/doQlohs0evoHrWOJqXyn4A4xbSVEtXnMEZZiw==", + "dev": true + }, + "@types/d3-cloud": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/d3-cloud/-/d3-cloud-1.2.3.tgz", + "integrity": "sha512-VUcRA9YWM1V5Srg444/zVxgmhVyIYBrChIr5lg+0cPGNM4J4fLdBqEeAkk9ggRPM3Um4fUy/p/gtEKbAqL/hcw==", + "dev": true, + "requires": { + "@types/d3": "^3" + }, + "dependencies": { + "@types/d3": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-3.5.44.tgz", + "integrity": "sha512-hFEcf03YGJ2uQoDYEp3nFD5mXWxly5kf6KOstuOQFEs9sUCN7kNlKhcYkpZ3gK6PiHz4XRLkoHa80NVCJNeLBw==", + "dev": true + } + } + }, + "@types/d3-color": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-2.0.1.tgz", + "integrity": "sha512-u7LTCL7RnaavFSmob2rIAJLNwu50i6gFwY9cHFr80BrQURYQBRkJ+Yv47nA3Fm7FeRhdWTiVTeqvSeOuMAOzBQ==", + "dev": true + }, + "@types/d3-contour": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-2.0.0.tgz", + "integrity": "sha512-PS9UO6zBQqwHXsocbpdzZFONgK1oRUgWtjjh/iz2vM06KaXLInLiKZ9e3OLBRerc1cU2uJYpO+8zOnb6frvCGQ==", + "dev": true, + "requires": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "@types/d3-delaunay": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-5.3.0.tgz", + "integrity": "sha512-gJYcGxLu0xDZPccbUe32OUpeaNtd1Lz0NYJtko6ZLMyG2euF4pBzrsQXms67LHZCDFzzszw+dMhSL/QAML3bXw==", + "dev": true + }, + "@types/d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-2.0.0.tgz", + "integrity": "sha512-Sh0KW6z/d7uxssD7K4s4uCSzlEG/+SP+U47q098NVdOfFvUKNTvKAIV4XqjxsUuhE/854ARAREHOxkr9gQOCyg==", + "dev": true + }, + "@types/d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-2.0.0.tgz", + "integrity": "sha512-VaUJPjbMnDn02tcRqsHLRAX5VjcRIzCjBfeXTLGe6QjMn5JccB5Cz4ztMRXMJfkbC45ovgJFWuj6DHvWMX1thA==", + "dev": true, + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-dsv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-2.0.0.tgz", + "integrity": "sha512-wYqy7T8tQ/DmocwxmlPujllLI5fg3lb6/FrVVWkLUD+NsRV+kcE4nbRZg10G9yjJ8pK2ZXqu+VP5jQbN13uNRQ==", + "dev": true + }, + "@types/d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-2.0.0.tgz", + "integrity": "sha512-6aZrTyX5LG+ptofVHf+gTsThLRY1nhLotJjgY4drYqk1OkJMu2UvuoZRlPw2fffjRHeYepue3/fxTufqKKmvsA==", + "dev": true + }, + "@types/d3-fetch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-2.0.0.tgz", + "integrity": "sha512-WnLepGtxepFfXRdPI8I5FTgNiHn9p4vMTTqaNCzJJfAswXx0rOY2jjeolzEU063em3iJmGZ+U79InnEeFOrCRw==", + "dev": true, + "requires": { + "@types/d3-dsv": "*" + } + }, + "@types/d3-force": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-2.1.0.tgz", + "integrity": "sha512-LGDtC2YADu8OBniq9EBx/MOsXsMcJbEkmfSpXuz6oVdRamB+3CLCiq5EKFPEILGZQckkilGFq1ZTJ7kc289k+Q==", + "dev": true + }, + "@types/d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-uagdkftxnGkO4pZw5jEYOM5ZnZOEsh7z8j11Qxk85UkB2RzfUUxRl7R9VvvJZHwKn8l+x+rpS77Nusq7FkFmIg==", + "dev": true + }, + "@types/d3-geo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-2.0.0.tgz", + "integrity": "sha512-DHHgYXW36lnAEQMYU2udKVOxxljHrn2EdOINeSC9jWCAXwOnGn7A19B8sNsHqgpu4F7O2bSD7//cqBXD3W0Deg==", + "dev": true, + "requires": { + "@types/geojson": "*" + } + }, + "@types/d3-hierarchy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-2.0.0.tgz", + "integrity": "sha512-YxdskUvwzqggpnSnDQj4KVkicgjpkgXn/g/9M9iGsiToLS3nG6Ytjo1FoYhYVAAElV/fJBGVL3cQ9Hb7tcv+lw==", + "dev": true + }, + "@types/d3-interpolate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-2.0.0.tgz", + "integrity": "sha512-Wt1v2zTlEN8dSx8hhx6MoOhWQgTkz0Ukj7owAEIOF2QtI0e219paFX9rf/SLOr/UExWb1TcUzatU8zWwFby6gg==", + "dev": true, + "requires": { + "@types/d3-color": "*" + } + }, + "@types/d3-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-2.0.0.tgz", + "integrity": "sha512-tXcR/9OtDdeCIsyl6eTNHC3XOAOdyc6ceF3QGBXOd9jTcK+ex/ecr00p9L9362e/op3UEPpxrToi1FHrtTSj7Q==", + "dev": true + }, + "@types/d3-polygon": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-2.0.0.tgz", + "integrity": "sha512-fISnMd8ePED1G4aa4V974Jmt+ajHSgPoxMa2D0ULxMybpx0Vw4WEzhQEaMIrL3hM8HVRcKTx669I+dTy/4PhAw==", + "dev": true + }, + "@types/d3-quadtree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-2.0.0.tgz", + "integrity": "sha512-YZuJuGBnijD0H+98xMJD4oZXgv/umPXy5deu3IimYTPGH3Kr8Th6iQUff0/6S80oNBD7KtOuIHwHUCymUiRoeQ==", + "dev": true + }, + "@types/d3-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-2.2.0.tgz", + "integrity": "sha512-Hjfj9m68NmYZzushzEG7etPvKH/nj9b9s9+qtkNG3/dbRBjQZQg1XS6nRuHJcCASTjxXlyXZnKu2gDxyQIIu9A==", + "dev": true + }, + "@types/d3-scale": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-3.2.1.tgz", + "integrity": "sha512-j+FryQSVk3GHLqjOX/RsHwGHg4XByJ0xIO1ASBTgzhE9o1tgeV4kEWLOzMzJRembKalflk5F03lEkM+4V6LDrQ==", + "dev": true, + "requires": { + "@types/d3-time": "*" + } + }, + "@types/d3-scale-chromatic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-2.0.0.tgz", + "integrity": "sha512-Y62+2clOwZoKua84Ha0xU77w7lePiaBoTjXugT4l8Rd5LAk+Mn/ZDtrgs087a+B5uJ3jYUHHtKw5nuEzp0WBHw==", + "dev": true + }, + "@types/d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-2.0.0.tgz", + "integrity": "sha512-EF0lWZ4tg7oDFg4YQFlbOU3936e3a9UmoQ2IXlBy1+cv2c2Pv7knhKUzGlH5Hq2sF/KeDTH1amiRPey2rrLMQA==", + "dev": true + }, + "@types/d3-shape": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-2.0.0.tgz", + "integrity": "sha512-NLzD02m5PiD1KLEDjLN+MtqEcFYn4ZL9+Rqc9ZwARK1cpKZXd91zBETbe6wpBB6Ia0D0VZbpmbW3+BsGPGnCpA==", + "dev": true, + "requires": { + "@types/d3-path": "^1" + }, + "dependencies": { + "@types/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-NaIeSIBiFgSC6IGUBjZWcscUJEq7vpVu7KthHN8eieTV9d9MqkSOZLH4chq1PmcKy06PNe3axLeKmRIyxJ+PZQ==", + "dev": true + } + } + }, + "@types/d3-time": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-2.0.0.tgz", + "integrity": "sha512-Abz8bTzy8UWDeYs9pCa3D37i29EWDjNTjemdk0ei1ApYVNqulYlGUKip/jLOpogkPSsPz/GvZCYiC7MFlEk0iQ==", + "dev": true + }, + "@types/d3-time-format": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-3.0.0.tgz", + "integrity": "sha512-UpLg1mn/8PLyjr+J/JwdQJM/GzysMvv2CS8y+WYAL5K0+wbvXv/pPSLEfdNaprCZsGcXTxPsFMy8QtkYv9ueew==", + "dev": true + }, + "@types/d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-2.0.0.tgz", + "integrity": "sha512-l6stHr1VD1BWlW6u3pxrjLtJfpPZq9I3XmKIQtq7zHM/s6fwEtI1Yn6Sr5/jQTrUDCC5jkS6gWqlFGCDArDqNg==", + "dev": true + }, + "@types/d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-2.0.0.tgz", + "integrity": "sha512-UJDzI98utcZQUJt3uIit/Ho0/eBIANzrWJrTmi4+TaKIyWL2iCu7ShP0o4QajCskhyjOA7C8+4CE3b1YirTzEQ==", + "dev": true, + "requires": { + "@types/d3-selection": "*" + } + }, + "@types/d3-zoom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-2.0.0.tgz", + "integrity": "sha512-daL0PJm4yT0ISTGa7p2lHX0kvv9FO/IR1ooWbHR/7H4jpbaKiLux5FslyS/OvISPiJ5SXb4sOqYhO6fMB6hKRw==", + "dev": true, + "requires": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", + "dev": true + }, + "@types/dompurify": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-2.0.4.tgz", + "integrity": "sha512-y6K7NyXTQvjr8hJNsAFAD8yshCsIJ0d+OYEFzULuIqWyWOKL2hRru1I+rorI5U0K4SLAROTNuSUFXPDTu278YA==", "dev": true, "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "@types/trusted-types": "*" } }, - "@types/babel__traverse": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.11.tgz", - "integrity": "sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q==", + "@types/enzyme": { + "version": "3.10.8", + "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.8.tgz", + "integrity": "sha512-vlOuzqsTHxog6PV79+tvOHFb6hq4QZKMq1lLD9MaWD1oec2lHTKndn76XOpSwCA0oFTaIbKVPrgM3k78Jjd16g==", "dev": true, "requires": { - "@babel/types": "^7.3.0" + "@types/cheerio": "*", + "@types/react": "*" } }, + "@types/geojson": { + "version": "7946.0.7", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz", + "integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ==", + "dev": true + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -1642,18 +2385,233 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "26.0.18", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.18.tgz", + "integrity": "sha512-scDPs+mELZgsFetTgBSsIxKGrlitn9t/d2ecP+S1QSIGD+31fkMBEftLfOAX5k3tU06/0PjreJIQ+gWEbbHqpw==", + "dev": true, + "requires": { + "jest-diff": "^26.0.0", + "pretty-format": "^26.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/yargs": { + "version": "15.0.11", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.11.tgz", + "integrity": "sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "diff-sequences": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "jest-diff": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + } + }, + "jest-get-type": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", + "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", + "dev": true + }, + "pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + } + }, + "react-is": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@types/leaflet": { + "version": "1.5.19", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.5.19.tgz", + "integrity": "sha512-ZAKqfvdU/+KFoCpf8aUba09F8mfSc8R2esq++Cha3E2DgwS5K/I/4eJ+0JylrVHZivgY7PSAeXFv/izP+81/MQ==", + "dev": true, + "requires": { + "@types/geojson": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, "@types/node": { "version": "13.13.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==", "dev": true }, + "@types/numeral": { + "version": "0.0.28", + "resolved": "https://registry.npmjs.org/@types/numeral/-/numeral-0.0.28.tgz", + "integrity": "sha512-Sjsy10w6XFHDktJJdXzBJmoondAKW+LcGpRFH+9+zXEDj0cOH8BxJuZA9vUDSMAzU1YRJlsPKmZEEiTYDlICLw==", + "dev": true + }, + "@types/plotly.js": { + "version": "1.54.4", + "resolved": "https://registry.npmjs.org/@types/plotly.js/-/plotly.js-1.54.4.tgz", + "integrity": "sha512-qKqNIw09Huuzz3/vkHXQeObLPMf7jbe99uTK246ZSh502xpldJxFuOmubPgSgq3bchRVJeR+mM0Dm6/FctL6tg==", + "dev": true, + "requires": { + "@types/d3": "^3" + }, + "dependencies": { + "@types/d3": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-3.5.44.tgz", + "integrity": "sha512-hFEcf03YGJ2uQoDYEp3nFD5mXWxly5kf6KOstuOQFEs9sUCN7kNlKhcYkpZ3gK6PiHz4XRLkoHa80NVCJNeLBw==", + "dev": true + } + } + }, + "@types/prop-types": { + "version": "15.7.3", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", + "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==", + "dev": true + }, + "@types/react": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.0.tgz", + "integrity": "sha512-aj/L7RIMsRlWML3YB6KZiXB3fV2t41+5RBGYF8z+tAKU43Px8C3cYUZsDvf1/+Bm4FK21QWBrDutu8ZJ/70qOw==", + "dev": true, + "requires": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.0.tgz", + "integrity": "sha512-lUqY7OlkF/RbNtD5nIq7ot8NquXrdFrjSOR6+w9a9RFQevGi1oZO1dcJbXMeONAPKtZ2UrZOEJ5UOCVsxbLk/g==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", "dev": true }, + "@types/tinycolor2": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-PeHg/AtdW6aaIO2a+98Xj7rWY4KC1E6yOy7AFknJQ7VXUGNrMlyxDFxJo7HqLtjQms/ZhhQX52mLVW/EX3JGOw==", + "dev": true + }, + "@types/trusted-types": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-1.0.6.tgz", + "integrity": "sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw==", + "dev": true + }, "@types/yargs": { "version": "13.0.8", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", @@ -2023,6 +2981,12 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "optional": true }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -2114,6 +3078,12 @@ "resolved": "https://registry.npmjs.org/array-bounds/-/array-bounds-1.0.1.tgz", "integrity": "sha512-8wdW3ZGk6UjMPJx/glyEt0sLzzwAE1bhToPsO1W2pbpR2gULyxe3BjSiuJFheP50T/GgODVPz2fuMUmIywt8cQ==" }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, "array-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", @@ -2144,6 +3114,12 @@ "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==" }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -2170,6 +3146,12 @@ "es-abstract": "^1.17.0-next.1" } }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -2236,6 +3218,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "ast-types": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.11.7.tgz", + "integrity": "sha512-2mP3TwtkY/aTv5X3ZsMpNAbOnyoC/aMJwJSoaELPkHId0nSQgFcnU4dRW3isxiz7+zBexk0ym3WNVjMiQBnJSw==", + "dev": true + }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", @@ -2260,6 +3248,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -2340,6 +3334,12 @@ "follow-redirects": "1.5.10" } }, + "babel-core": { + "version": "7.0.0-bridge.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", + "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", + "dev": true + }, "babel-jest": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", @@ -3238,6 +4238,15 @@ "uniq": "^1.0.1" } }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", @@ -3346,6 +4355,12 @@ "lerp": "^1.0.3" } }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3553,6 +4568,17 @@ "sha.js": "^2.4.8" } }, + "create-jest-runner": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/create-jest-runner/-/create-jest-runner-0.5.3.tgz", + "integrity": "sha512-a9VY2doMBmzRollJB3Ft3/Y5fBceSWJ4gdyVsg4/d7nP1S4715VG939s2VnITDj79YBmRgKhjGjNRv1c+Kre1g==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "jest-worker": "^24.0.0", + "throat": "^4.1.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -3720,6 +4746,12 @@ "cssom": "0.3.x" } }, + "csstype": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.5.tgz", + "integrity": "sha512-uVDi8LpBUKQj6sdxNaTetL6FpeCqTjOvAQuQUa/qAqq8oOd4ivkbhgnqayl0dnPal8Tb/yB1tF+gOvCBiicaiQ==", + "dev": true + }, "cubic-hermite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cubic-hermite/-/cubic-hermite-1.0.0.tgz", @@ -4051,6 +5083,15 @@ "integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=", "dev": true }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -4280,6 +5321,15 @@ } } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -4447,50 +5497,379 @@ "ext": "^1.1.2" } }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "escodegen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", + "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + } + } + }, + "eslint": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz", + "integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.2.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "escodegen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", - "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "eslint-visitor-keys": "^1.1.0" }, "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true } } }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "esprima": { @@ -4498,6 +5877,23 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", @@ -4768,6 +6164,74 @@ "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "fast-isnumeric": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/fast-isnumeric/-/fast-isnumeric-1.1.4.tgz", @@ -4787,6 +6251,15 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, + "fastq": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -4802,6 +6275,24 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", + "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "file-loader": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz", @@ -4931,6 +6422,33 @@ "resolve-dir": "^1.0.1" } }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", + "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", + "dev": true + }, "flatten-vertex-data": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz", @@ -4944,6 +6462,12 @@ "resolved": "https://registry.npmjs.org/flip-pixels/-/flip-pixels-1.0.2.tgz", "integrity": "sha512-oXbJGbjDnfJRWPC7Va38EFhd+A8JWE5/hCiKcK8qjCdbLj9DTpsq6MEudwpRTH+V4qq+Jw7d3pUgQdSr3x3mTA==" }, + "flow-parser": { + "version": "0.139.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.139.0.tgz", + "integrity": "sha512-yEh5wJIi/BG7JZvWAWxTdfZ1uoh/W3oefJOuvUDosKFIE5H7ad8Eu6k9ba1yr83Lxn5vY6kZMG1IaiiiA/5scg==", + "dev": true + }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -5047,6 +6571,18 @@ "readable-stream": "^2.0.0" } }, + "fs-extra": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -6637,6 +8173,12 @@ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "dev": true }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "image-palette": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/image-palette/-/image-palette-2.1.0.tgz", @@ -6662,6 +8204,24 @@ "invariant": "^2.2.0" } }, + "import-fresh": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -6764,6 +8324,16 @@ "resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz", "integrity": "sha1-ge9X/l0FgUzVjCSDYyqZwwoOgIc=" }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -6946,6 +8516,12 @@ "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-2.2.1.tgz", "integrity": "sha512-6zELsfVFr326eq2CI53yvqq6YBanOxKBybwDT+MbMS2laBnK6Ez8m5XHSuTQQbnKRfpDzCod1CMWW5q3wZYMvA==" }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -6999,6 +8575,15 @@ "has": "^1.0.3" } }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -7041,6 +8626,15 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -7781,6 +9375,32 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jscodeshift": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.6.4.tgz", + "integrity": "sha512-+NF/tlNbc2WEhXUuc4WEJLsJumF84tnaMUZW2hyJw3jThKKRvsPX4sPJVgO1lPE28z0gNL+gwniLG9d8mYvQCQ==", + "dev": true, + "requires": { + "@babel/core": "^7.1.6", + "@babel/parser": "^7.1.6", + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/preset-env": "^7.1.6", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-typescript": "^7.1.0", + "@babel/register": "^7.0.0", + "babel-core": "^7.0.0-bridge.0", + "colors": "^1.1.2", + "flow-parser": "0.*", + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "neo-async": "^2.5.0", + "node-dir": "^0.1.17", + "recast": "^0.16.1", + "temp": "^0.8.1", + "write-file-atomic": "^2.3.0" + } + }, "jsdom": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", @@ -7853,6 +9473,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -7868,6 +9494,33 @@ "minimist": "^1.2.5" } }, + "json5-writer": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/json5-writer/-/json5-writer-0.1.8.tgz", + "integrity": "sha512-h5sqkk/vSKvESOUTBniGWs8p8nTzHsoDrxPS9enJfQVINqXv3lm+FAyizLwbrCwCn0q7NXqDBb+r8AdUdK3XZw==", + "dev": true, + "requires": { + "jscodeshift": "^0.6.3" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -8114,6 +9767,17 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "log-update": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-3.4.0.tgz", + "integrity": "sha512-ILKe88NeMt4gmDvk/eb615U/IVn7K9KWGkoYbdatQ69Z65nj1ZzjM6fHXfcs0Uge+e+EGnMW7DY4T9yko8vWFg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "cli-cursor": "^2.1.0", + "wrap-ansi": "^5.0.0" + } + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -8346,6 +10010,12 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -8563,6 +10233,19 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, "mumath": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/mumath/-/mumath-3.3.4.tgz", @@ -8746,6 +10429,15 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", + "dev": true, + "requires": { + "minimatch": "^3.0.2" + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -9065,6 +10757,23 @@ "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + } + } + }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -9191,6 +10900,15 @@ "readable-stream": "^2.1.5" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parenthesis": { "version": "3.1.7", "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.7.tgz", @@ -9359,6 +11077,12 @@ "resolved": "https://registry.npmjs.org/pick-by-alias/-/pick-by-alias-1.2.0.tgz", "integrity": "sha1-X3yysfIabh6ISgyHhVqko3NhEHs=" }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pidtree": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", @@ -9729,6 +11453,12 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", @@ -10168,6 +11898,26 @@ "util.promisify": "^1.0.0" } }, + "recast": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.16.2.tgz", + "integrity": "sha512-O/7qXi51DPjRVdbrpNzoBQH5dnAPQNbfoOFyRiUwreTMJfIHYOEBzwuH+c0+/BTSJ3CQyKs6ILSWXhESH6Op3A==", + "dev": true, + "requires": { + "ast-types": "0.11.7", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "redeyed": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-0.4.4.tgz", @@ -10251,6 +12001,12 @@ "es-abstract": "^1.17.0-next.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "regexpu-core": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", @@ -10508,6 +12264,16 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", @@ -10522,6 +12288,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -10661,6 +12433,12 @@ "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", "dev": true }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -10949,6 +12727,17 @@ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -11595,6 +13384,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, "strongly-connected-components": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", @@ -11708,6 +13503,18 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -11736,6 +13543,26 @@ "through": "~2.3.8" } }, + "temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", + "dev": true, + "requires": { + "rimraf": "~2.6.2" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "terser": { "version": "4.6.11", "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.11.tgz", @@ -11815,6 +13642,12 @@ "vectorize-text": "^3.2.1" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "throat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", @@ -12024,6 +13857,287 @@ "cdt2d": "^1.0.0" } }, + "ts-migrate": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ts-migrate/-/ts-migrate-0.1.10.tgz", + "integrity": "sha512-yARvC786gmv+HOw18GIt9PKemVfEINc5hl6Ybrkv/t80w2nxycv1MhQ/NmGNanfuO1xayqiBgoi9TNshzQQm6g==", + "dev": true, + "requires": { + "create-jest-runner": "^0.5.3", + "json5": "^2.1.1", + "json5-writer": "^0.1.8", + "ts-migrate-plugins": "^0.1.10", + "ts-migrate-server": "^0.1.10", + "typescript": "4.0.2", + "updatable-log": "^0.2.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "ts-migrate-plugins": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ts-migrate-plugins/-/ts-migrate-plugins-0.1.10.tgz", + "integrity": "sha512-Tk7dIpSR/fJDNVN2ZemqHAz2jV/6TvD0NgOk5BGuFXkHZQsXz+mRr2LMmxxRHPGtck8Cj9r3hzz6tLhUgyyVBQ==", + "dev": true, + "requires": { + "eslint": "^7.8.1", + "jscodeshift": "^0.7.0", + "ts-migrate-server": "^0.1.10", + "typescript": "4.0.2" + }, + "dependencies": { + "ast-types": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.3.tgz", + "integrity": "sha512-XTZ7xGML849LkQP86sWdQzfhwbt3YwIO6MqbX9mUNYY98VKaaVZP7YNNm70IpwecbkkxmfC5IYAzOQ/2p29zRA==", + "dev": true + }, + "jscodeshift": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.7.1.tgz", + "integrity": "sha512-YMkZSyoc8zg5woZL23cmWlnFLPH/mHilonGA7Qbzs7H6M4v4PH0Qsn4jeDyw+CHhVoAnm9UxQyB0Yw1OT+mktA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.6", + "@babel/parser": "^7.1.6", + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/preset-env": "^7.1.6", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-typescript": "^7.1.0", + "@babel/register": "^7.0.0", + "babel-core": "^7.0.0-bridge.0", + "colors": "^1.1.2", + "flow-parser": "0.*", + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "neo-async": "^2.5.0", + "node-dir": "^0.1.17", + "recast": "^0.18.1", + "temp": "^0.8.1", + "write-file-atomic": "^2.3.0" + } + }, + "recast": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.18.10.tgz", + "integrity": "sha512-XNvYvkfdAN9QewbrxeTOjgINkdY/odTgTS56ZNEWL9Ml0weT4T3sFtvnTuF+Gxyu46ANcRm1ntrF6F5LAJPAaQ==", + "dev": true, + "requires": { + "ast-types": "0.13.3", + "esprima": "~4.0.0", + "private": "^0.1.8", + "source-map": "~0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + } + } + }, + "ts-migrate-server": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/ts-migrate-server/-/ts-migrate-server-0.1.10.tgz", + "integrity": "sha512-vwVVgg1fI1aeYmV0/qtgETGnYMl57O2FopSynLHYU8aafa1bha6xDgoBsYa8w8AYVEtyMHt2F8WsHqmnyX/dJQ==", + "dev": true, + "requires": { + "@ts-morph/bootstrap": "^0.6.0", + "typescript": "4.0.2", + "updatable-log": "^0.2.0" + }, + "dependencies": { + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + } + } + }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", @@ -12084,6 +14198,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "type-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", @@ -12103,6 +14223,12 @@ "dup": "^1.0.0" } }, + "typescript": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz", + "integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==", + "dev": true + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -12119,6 +14245,12 @@ "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", "optional": true }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -12183,6 +14315,12 @@ "imurmurhash": "^0.1.4" } }, + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + }, "unquote": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", @@ -12234,6 +14372,17 @@ "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, + "updatable-log": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/updatable-log/-/updatable-log-0.2.0.tgz", + "integrity": "sha512-gR48/mTR6YFB+B1sNoap3nx8HFbEvDl0ej9KhlQTFZdmP8yL5fzFiCUfeHCUf1QvNnXowY1pM9iiGkPKrd0XyQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "figures": "^3.0.0", + "log-update": "^3.3.0" + } + }, "update-diff": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-diff/-/update-diff-1.1.0.tgz", diff --git a/viz-lib/package.json b/viz-lib/package.json index c5f2e79b29..4850569e30 100644 --- a/viz-lib/package.json +++ b/viz-lib/package.json @@ -5,10 +5,13 @@ "main": "dist/redash-visualizations.js", "scripts": { "clean": "rm -rf lib dist", - "build:babel": "babel src --out-dir lib --source-maps --ignore 'src/**/*.test.js' --copy-files --no-copy-ignored", + "type-check": "tsc --noEmit", + "type-gen": "tsc --emitDeclarationOnly", + "build:babel:base": "babel src --out-dir lib --source-maps --ignore 'src/**/*.test.js' --copy-files --no-copy-ignored --extensions .ts,.tsx,.js,.jsx", + "build:babel": "npm run type-gen && npm run build:babel:base", "build:webpack": "webpack", "build": " NODE_ENV=production npm-run-all clean build:babel build:webpack", - "watch:babel": "babel src --watch --out-dir lib --source-maps --ignore 'src/**/*.test.js' --copy-files --no-copy-ignored", + "watch:babel": "npm run build:babel:base -- --watch", "watch:webpack": "webpack --watch", "watch": "npm-run-all --parallel watch:*", "version": "npm run build", @@ -34,6 +37,20 @@ "@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/preset-env": "^7.9.0", "@babel/preset-react": "^7.9.4", + "@babel/preset-typescript": "^7.12.7", + "@types/chroma-js": "^2.1.2", + "@types/d3": "^6.2.0", + "@types/d3-cloud": "^1.2.3", + "@types/debug": "^4.1.5", + "@types/dompurify": "^2.0.4", + "@types/enzyme": "^3.10.8", + "@types/jest": "^26.0.18", + "@types/leaflet": "^1.5.19", + "@types/numeral": "0.0.28", + "@types/plotly.js": "^1.54.4", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "@types/tinycolor2": "^1.4.2", "babel-loader": "^8.1.0", "babel-plugin-istanbul": "^6.0.0", "babel-plugin-module-resolver": "^4.0.0", @@ -50,6 +67,8 @@ "prettier": "^1.19.1", "prop-types": "^15.7.2", "style-loader": "^1.1.4", + "ts-migrate": "^0.1.10", + "typescript": "^4.1.2", "webpack": "^4.42.1", "webpack-cli": "^3.3.11" }, diff --git a/viz-lib/src/components/ColorPicker/Input.jsx b/viz-lib/src/components/ColorPicker/Input.tsx similarity index 79% rename from viz-lib/src/components/ColorPicker/Input.jsx rename to viz-lib/src/components/ColorPicker/Input.tsx index 47b89fd6ad..cca75420da 100644 --- a/viz-lib/src/components/ColorPicker/Input.jsx +++ b/viz-lib/src/components/ColorPicker/Input.tsx @@ -1,6 +1,5 @@ import { isNil, isArray, chunk, map, filter, toPairs } from "lodash"; import React, { useState, useEffect } from "react"; -import PropTypes from "prop-types"; import tinycolor from "tinycolor2"; import TextInput from "antd/lib/input"; import Typography from "antd/lib/typography"; @@ -8,7 +7,7 @@ import Swatch from "./Swatch"; import "./input.less"; -function preparePresets(presetColors, presetColumns) { +function preparePresets(presetColors: any, presetColumns: any) { presetColors = isArray(presetColors) ? map(presetColors, v => [null, v]) : toPairs(presetColors); presetColors = map(presetColors, ([title, value]) => { if (isNil(value)) { @@ -23,7 +22,7 @@ function preparePresets(presetColors, presetColumns) { return chunk(filter(presetColors), presetColumns); } -function validateColor(value, callback, prefix = "#") { +function validateColor(value: any, callback: any, prefix = "#") { if (isNil(value)) { callback(null); } @@ -33,13 +32,25 @@ function validateColor(value, callback, prefix = "#") { } } -export default function Input({ color, presetColors, presetColumns, onChange, onPressEnter }) { +type OwnProps = { + color?: string; + presetColors?: string[] | { + [key: string]: string; + }; + presetColumns?: number; + onChange?: (...args: any[]) => any; + onPressEnter?: (...args: any[]) => any; +}; + +type Props = OwnProps & typeof Input.defaultProps; + +export default function Input({ color, presetColors, presetColumns, onChange, onPressEnter }: Props) { const [inputValue, setInputValue] = useState(""); const [isInputFocused, setIsInputFocused] = useState(false); const presets = preparePresets(presetColors, presetColumns); - function handleInputChange(value) { + function handleInputChange(value: any) { setInputValue(value); validateColor(value, onChange); } @@ -55,6 +66,7 @@ export default function Input({ color, presetColors, presetColumns, onChange, on {map(presets, (group, index) => (

{map(group, ([title, value]) => ( + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any' is not assignable to type 'never'. validateColor(value, onChange)} /> ))}
@@ -74,17 +86,6 @@ export default function Input({ color, presetColors, presetColumns, onChange, on ); } -Input.propTypes = { - color: PropTypes.string, - presetColors: PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.string), // array of colors (no tooltips) - PropTypes.objectOf(PropTypes.string), // color name => color value - ]), - presetColumns: PropTypes.number, - onChange: PropTypes.func, - onPressEnter: PropTypes.func, -}; - Input.defaultProps = { color: "#FFFFFF", presetColors: null, diff --git a/viz-lib/src/components/ColorPicker/Label.jsx b/viz-lib/src/components/ColorPicker/Label.tsx similarity index 61% rename from viz-lib/src/components/ColorPicker/Label.jsx rename to viz-lib/src/components/ColorPicker/Label.tsx index 1cd8a4decf..ea925d7b47 100644 --- a/viz-lib/src/components/ColorPicker/Label.jsx +++ b/viz-lib/src/components/ColorPicker/Label.tsx @@ -1,11 +1,21 @@ import React, { useMemo } from "react"; -import PropTypes from "prop-types"; import cx from "classnames"; import { validateColor, getColorName } from "./utils"; import "./label.less"; -export default function Label({ className, color, presetColors, ...props }) { +type OwnProps = { + className?: string; + color?: string; + presetColors?: string[] | { + [key: string]: string; + }; +}; + +type Props = OwnProps & typeof Label.defaultProps; + +// @ts-expect-error ts-migrate(2700) FIXME: Rest types may only be created from object types. +export default function Label({ className, color, presetColors, ...props }: Props) { const name = useMemo(() => getColorName(validateColor(color), presetColors), [color, presetColors]); return ( @@ -15,15 +25,6 @@ export default function Label({ className, color, presetColors, ...props }) { ); } -Label.propTypes = { - className: PropTypes.string, - color: PropTypes.string, - presetColors: PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.string), // array of colors (no tooltips) - PropTypes.objectOf(PropTypes.string), // color name => color value - ]), -}; - Label.defaultProps = { className: null, color: "#FFFFFF", diff --git a/viz-lib/src/components/ColorPicker/Swatch.jsx b/viz-lib/src/components/ColorPicker/Swatch.tsx similarity index 60% rename from viz-lib/src/components/ColorPicker/Swatch.jsx rename to viz-lib/src/components/ColorPicker/Swatch.tsx index 0be5571f6f..a6848751a4 100644 --- a/viz-lib/src/components/ColorPicker/Swatch.jsx +++ b/viz-lib/src/components/ColorPicker/Swatch.tsx @@ -1,15 +1,26 @@ import { isString } from "lodash"; import React from "react"; -import PropTypes from "prop-types"; import cx from "classnames"; import Tooltip from "antd/lib/tooltip"; import "./swatch.less"; -export default function Swatch({ className, color, title, size, style, ...props }) { +type OwnProps = { + className?: string; + style?: any; + title?: string; + color?: string; + size?: number; +}; + +type Props = OwnProps & typeof Swatch.defaultProps; + +// @ts-expect-error ts-migrate(2700) FIXME: Rest types may only be created from object types. +export default function Swatch({ className, color, title, size, style, ...props }: Props) { const result = ( @@ -25,14 +36,6 @@ export default function Swatch({ className, color, title, size, style, ...props return result; } -Swatch.propTypes = { - className: PropTypes.string, - style: PropTypes.object, - title: PropTypes.string, - color: PropTypes.string, - size: PropTypes.number, -}; - Swatch.defaultProps = { className: null, style: null, diff --git a/viz-lib/src/components/ColorPicker/index.jsx b/viz-lib/src/components/ColorPicker/index.tsx similarity index 61% rename from viz-lib/src/components/ColorPicker/index.jsx rename to viz-lib/src/components/ColorPicker/index.tsx index 59b33bc6de..61a4da86d9 100644 --- a/viz-lib/src/components/ColorPicker/index.jsx +++ b/viz-lib/src/components/ColorPicker/index.tsx @@ -1,6 +1,5 @@ import { toString } from "lodash"; import React, { useState, useEffect, useMemo } from "react"; -import PropTypes from "prop-types"; import cx from "classnames"; import Popover from "antd/lib/popover"; import Card from "antd/lib/card"; @@ -17,18 +16,24 @@ import { validateColor } from "./utils"; import "./index.less"; -export default function ColorPicker({ - color, - placement, - presetColors, - presetColumns, - interactive, - children, - onChange, - triggerProps, - addonBefore, - addonAfter, -}) { +type OwnProps = { + color?: string; + placement?: "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom"; + presetColors?: string[] | { + [key: string]: string; + }; + presetColumns?: number; + interactive?: boolean; + triggerProps?: any; + children?: React.ReactNode; + addonBefore?: React.ReactNode; + addonAfter?: React.ReactNode; + onChange?: (...args: any[]) => any; +}; + +type Props = OwnProps & typeof ColorPicker.defaultProps; + +export default function ColorPicker({ color, placement, presetColors, presetColumns, interactive, children, onChange, triggerProps, addonBefore, addonAfter, }: Props) { const [visible, setVisible] = useState(false); const validatedColor = useMemo(() => validateColor(color), [color]); const [currentColor, setCurrentColor] = useState(""); @@ -36,6 +41,7 @@ export default function ColorPicker({ function handleApply() { setVisible(false); if (!interactive) { + // @ts-expect-error ts-migrate(2349) FIXME: This expression is not callable. onChange(currentColor); } } @@ -58,15 +64,17 @@ export default function ColorPicker({ ); } - function handleInputChange(newColor) { + function handleInputChange(newColor: any) { setCurrentColor(newColor); if (interactive) { + // @ts-expect-error ts-migrate(2349) FIXME: This expression is not callable. onChange(newColor); } } useEffect(() => { if (visible) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'string | null' is not assignable... Remove this comment to see the full error message setCurrentColor(validatedColor); } }, [validatedColor, visible]); @@ -77,6 +85,7 @@ export default function ColorPicker({ void' is not assignable t... Remove this comment to see the full error message onChange={handleInputChange} + // @ts-expect-error ts-migrate(2322) FIXME: Type '() => void' is not assignable to type 'never... Remove this comment to see the full error message onPressEnter={handleApply} /> @@ -107,6 +120,7 @@ export default function ColorPicker({ color={validatedColor} size={30} {...triggerProps} + // @ts-expect-error ts-migrate(2339) FIXME: Property 'className' does not exist on type 'never... Remove this comment to see the full error message className={cx("color-picker-trigger", triggerProps.className)} /> )} @@ -116,35 +130,6 @@ export default function ColorPicker({ ); } -ColorPicker.propTypes = { - color: PropTypes.string, - placement: PropTypes.oneOf([ - "top", - "left", - "right", - "bottom", - "topLeft", - "topRight", - "bottomLeft", - "bottomRight", - "leftTop", - "leftBottom", - "rightTop", - "rightBottom", - ]), - presetColors: PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.string), // array of colors (no tooltips) - PropTypes.objectOf(PropTypes.string), // color name => color value - ]), - presetColumns: PropTypes.number, - interactive: PropTypes.bool, - triggerProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types - children: PropTypes.node, - addonBefore: PropTypes.node, - addonAfter: PropTypes.node, - onChange: PropTypes.func, -}; - ColorPicker.defaultProps = { color: "#FFFFFF", placement: "top", diff --git a/viz-lib/src/components/ColorPicker/utils.js b/viz-lib/src/components/ColorPicker/utils.ts similarity index 71% rename from viz-lib/src/components/ColorPicker/utils.js rename to viz-lib/src/components/ColorPicker/utils.ts index 1af3670437..4736e786ac 100644 --- a/viz-lib/src/components/ColorPicker/utils.js +++ b/viz-lib/src/components/ColorPicker/utils.ts @@ -1,12 +1,12 @@ import { isArray, findKey } from "lodash"; import tinycolor from "tinycolor2"; -export function validateColor(value, fallback = null) { +export function validateColor(value: any, fallback = null) { value = tinycolor(value); return value.isValid() ? "#" + value.toHex().toUpperCase() : fallback; } -export function getColorName(color, presetColors) { +export function getColorName(color: any, presetColors: any) { if (isArray(presetColors)) { return color; } diff --git a/viz-lib/src/components/ErrorBoundary.jsx b/viz-lib/src/components/ErrorBoundary.tsx similarity index 51% rename from viz-lib/src/components/ErrorBoundary.jsx rename to viz-lib/src/components/ErrorBoundary.tsx index c0e7e0d728..647f16126c 100644 --- a/viz-lib/src/components/ErrorBoundary.jsx +++ b/viz-lib/src/components/ErrorBoundary.tsx @@ -1,13 +1,12 @@ import { isFunction } from "lodash"; import React from "react"; -import PropTypes from "prop-types"; import debug from "debug"; import Alert from "antd/lib/alert"; const logger = debug("redash:errors"); export const ErrorBoundaryContext = React.createContext({ - handleError: error => { + handleError: (error: any) => { // Allow calling chain to roll up, and then throw the error in global context setTimeout(() => { throw error; @@ -16,23 +15,29 @@ export const ErrorBoundaryContext = React.createContext({ reset: () => {}, }); -export function ErrorMessage({ children }) { +type OwnErrorMessageProps = { + children?: React.ReactNode; +}; + +type ErrorMessageProps = OwnErrorMessageProps & typeof ErrorMessage.defaultProps; + +export function ErrorMessage({ children }: ErrorMessageProps) { return ; } -ErrorMessage.propTypes = { - children: PropTypes.node, -}; - ErrorMessage.defaultProps = { children: "Something went wrong.", }; -export default class ErrorBoundary extends React.Component { - static propTypes = { - children: PropTypes.node, - renderError: PropTypes.func, // error => ReactNode - }; +type OwnErrorBoundaryProps = { + renderError?: (...args: any[]) => any; +}; + +type ErrorBoundaryState = any; + +type ErrorBoundaryProps = OwnErrorBoundaryProps & typeof ErrorBoundary.defaultProps; + +export default class ErrorBoundary extends React.Component { static defaultProps = { children: null, @@ -41,10 +46,13 @@ export default class ErrorBoundary extends React.Component { state = { error: null }; - handleError = error => { + handleError = (error: any) => { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getDerivedStateFromError' does not exist... Remove this comment to see the full error message this.setState(this.constructor.getDerivedStateFromError(error)); this.componentDidCatch(error, null); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'handleException' does not exist on type ... Remove this comment to see the full error message if (isFunction(window.handleException)) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'handleException' does not exist on type ... Remove this comment to see the full error message window.handleException(error); } }; @@ -53,11 +61,11 @@ export default class ErrorBoundary extends React.Component { this.setState({ error: null }); }; - static getDerivedStateFromError(error) { + static getDerivedStateFromError(error: any) { return { error }; } - componentDidCatch(error, errorInfo) { + componentDidCatch(error: any, errorInfo: any) { logger(error, errorInfo); } @@ -67,6 +75,7 @@ export default class ErrorBoundary extends React.Component { if (error) { if (isFunction(renderError)) { + // @ts-expect-error ts-migrate(2349) FIXME: This expression is not callable. return renderError(error); } return ; diff --git a/viz-lib/src/components/HtmlContent.jsx b/viz-lib/src/components/HtmlContent.tsx similarity index 51% rename from viz-lib/src/components/HtmlContent.jsx rename to viz-lib/src/components/HtmlContent.tsx index d92082fedb..b30f9ece39 100644 --- a/viz-lib/src/components/HtmlContent.jsx +++ b/viz-lib/src/components/HtmlContent.tsx @@ -6,15 +6,18 @@ const HtmlContent = React.memo(function HtmlContent({ children, ...props }) { return (
); }); +// @ts-expect-error ts-migrate(2339) FIXME: Property 'propTypes' does not exist on type 'Named... Remove this comment to see the full error message HtmlContent.propTypes = { children: PropTypes.string, }; +// @ts-expect-error ts-migrate(2339) FIXME: Property 'defaultProps' does not exist on type 'Na... Remove this comment to see the full error message HtmlContent.defaultProps = { children: "", }; diff --git a/viz-lib/src/components/TextAlignmentSelect/index.jsx b/viz-lib/src/components/TextAlignmentSelect/index.tsx similarity index 87% rename from viz-lib/src/components/TextAlignmentSelect/index.jsx rename to viz-lib/src/components/TextAlignmentSelect/index.tsx index 44af1541e1..0ea6620910 100644 --- a/viz-lib/src/components/TextAlignmentSelect/index.jsx +++ b/viz-lib/src/components/TextAlignmentSelect/index.tsx @@ -1,6 +1,5 @@ import { pickBy, startsWith } from "lodash"; import React from "react"; -import PropTypes from "prop-types"; import cx from "classnames"; import Radio from "antd/lib/radio"; import Tooltip from "antd/lib/tooltip"; @@ -11,7 +10,14 @@ import AlignRightOutlinedIcon from "@ant-design/icons/AlignRightOutlined"; import "./index.less"; -export default function TextAlignmentSelect({ className, ...props }) { +type OwnProps = { + className?: string; +}; + +type Props = OwnProps & typeof TextAlignmentSelect.defaultProps; + +// @ts-expect-error ts-migrate(2700) FIXME: Rest types may only be created from object types. +export default function TextAlignmentSelect({ className, ...props }: Props) { return ( // Antd RadioGroup does not use any custom attributes
startsWith(k, "data-"))}> @@ -36,10 +42,6 @@ export default function TextAlignmentSelect({ className, ...props }) { ); } -TextAlignmentSelect.propTypes = { - className: PropTypes.string, -}; - TextAlignmentSelect.defaultProps = { className: null, }; diff --git a/viz-lib/src/components/json-view-interactive/JsonViewInteractive.jsx b/viz-lib/src/components/json-view-interactive/JsonViewInteractive.tsx similarity index 88% rename from viz-lib/src/components/json-view-interactive/JsonViewInteractive.jsx rename to viz-lib/src/components/json-view-interactive/JsonViewInteractive.tsx index 7c967e786d..41ba2293cd 100644 --- a/viz-lib/src/components/json-view-interactive/JsonViewInteractive.jsx +++ b/viz-lib/src/components/json-view-interactive/JsonViewInteractive.tsx @@ -3,11 +3,16 @@ import { isFinite, isString, isArray, isObject, keys, map } from "lodash"; import React, { useState } from "react"; import cx from "classnames"; -import PropTypes from "prop-types"; import "./json-view-interactive.less"; -function JsonBlock({ value, children, openingBrace, closingBrace, withKeys }) { +function JsonBlock({ + value, + children, + openingBrace, + closingBrace, + withKeys +}: any) { const [isExpanded, setIsExpanded] = useState(false); const objectKeys = keys(value); @@ -56,7 +61,10 @@ function JsonBlock({ value, children, openingBrace, closingBrace, withKeys }) { ); } -function JsonValue({ value, children }) { +function JsonValue({ + value, + children +}: any) { if (value === null || value === false || value === true || isFinite(value)) { return ( @@ -92,7 +100,13 @@ function JsonValue({ value, children }) { return null; } -export default function JsonViewInteractive({ value }) { +type OwnJsonViewInteractiveProps = { + value?: any; +}; + +type JsonViewInteractiveProps = OwnJsonViewInteractiveProps & typeof JsonViewInteractive.defaultProps; + +export default function JsonViewInteractive({ value }: JsonViewInteractiveProps) { return ( @@ -100,10 +114,6 @@ export default function JsonViewInteractive({ value }) { ); } -JsonViewInteractive.propTypes = { - value: PropTypes.any, // eslint-disable-line react/forbid-prop-types -}; - JsonViewInteractive.defaultProps = { // `null` will be rendered as "null" because it is a valid JSON value, so use `undefined` for no value value: undefined, diff --git a/viz-lib/src/components/sortable/index.jsx b/viz-lib/src/components/sortable/index.tsx similarity index 60% rename from viz-lib/src/components/sortable/index.jsx rename to viz-lib/src/components/sortable/index.tsx index c53c28ab53..e0dc569ed0 100644 --- a/viz-lib/src/components/sortable/index.jsx +++ b/viz-lib/src/components/sortable/index.tsx @@ -1,20 +1,36 @@ import { isFunction, wrap } from "lodash"; import React, { useRef, useState } from "react"; -import PropTypes from "prop-types"; import cx from "classnames"; +// @ts-expect-error ts-migrate(2724) FIXME: Module '"../../../node_modules/react-sortable-hoc/... Remove this comment to see the full error message import { sortableContainer, sortableElement, sortableHandle } from "react-sortable-hoc"; import "./style.less"; -export const DragHandle = sortableHandle(({ className, ...restProps }) => ( +export const DragHandle = sortableHandle(({ + className, + ...restProps +}: any) => (
)); -export const SortableContainerWrapper = sortableContainer(({ children }) => children); +export const SortableContainerWrapper = sortableContainer(({ + children +}: any) => children); -export const SortableElement = sortableElement(({ children }) => children); +export const SortableElement = sortableElement(({ + children +}: any) => children); -export function SortableContainer({ disabled, containerComponent, containerProps, children, ...wrapperProps }) { +type OwnProps = { + disabled?: boolean; + containerComponent?: React.ReactElement; + containerProps?: any; + children?: React.ReactNode; +}; + +type Props = OwnProps & typeof SortableContainer.defaultProps; + +export function SortableContainer({ disabled, containerComponent, containerProps, children, ...wrapperProps }: Props) { const containerRef = useRef(); const [isDragging, setIsDragging] = useState(false); @@ -25,22 +41,26 @@ export function SortableContainer({ disabled, containerComponent, containerProps // Disabled state: // - forbid drag'n'drop (and therefore no need to hook events // - don't override anything on container element + // @ts-expect-error ts-migrate(2339) FIXME: Property 'shouldCancelStart' does not exist on typ... Remove this comment to see the full error message wrapperProps.shouldCancelStart = () => true; } else { // Enabled state: // - use container element as a default helper element + // @ts-expect-error ts-migrate(2339) FIXME: Property 'helperContainer' does not exist on type ... Remove this comment to see the full error message wrapperProps.helperContainer = wrap(wrapperProps.helperContainer, helperContainer => isFunction(helperContainer) ? helperContainer(containerRef.current) : containerRef.current ); // - hook drag start/end events + // @ts-expect-error ts-migrate(2339) FIXME: Property 'updateBeforeSortStart' does not exist on... Remove this comment to see the full error message wrapperProps.updateBeforeSortStart = wrap(wrapperProps.updateBeforeSortStart, (updateBeforeSortStart, ...args) => { setIsDragging(true); if (isFunction(updateBeforeSortStart)) { updateBeforeSortStart(...args); } }); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'onSortEnd' does not exist on type '{}'. wrapperProps.onSortEnd = wrap(wrapperProps.onSortEnd, (onSortEnd, ...args) => { setIsDragging(false); if (isFunction(onSortEnd)) { @@ -60,18 +80,12 @@ export function SortableContainer({ disabled, containerComponent, containerProps const ContainerComponent = containerComponent; return ( + {/* @ts-expect-error ts-migrate(2604) FIXME: JSX element type 'ContainerComponent' does not hav... Remove this comment to see the full error message */} {children} ); } -SortableContainer.propTypes = { - disabled: PropTypes.bool, - containerComponent: PropTypes.elementType, - containerProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types - children: PropTypes.node, -}; - SortableContainer.defaultProps = { disabled: false, containerComponent: "div", diff --git a/viz-lib/src/components/visualizations/editor/ContextHelp.jsx b/viz-lib/src/components/visualizations/editor/ContextHelp.tsx similarity index 80% rename from viz-lib/src/components/visualizations/editor/ContextHelp.jsx rename to viz-lib/src/components/visualizations/editor/ContextHelp.tsx index 1d23f4c4c0..b0fc08afee 100644 --- a/viz-lib/src/components/visualizations/editor/ContextHelp.jsx +++ b/viz-lib/src/components/visualizations/editor/ContextHelp.tsx @@ -1,12 +1,18 @@ import React from "react"; -import PropTypes from "prop-types"; import Popover from "antd/lib/popover"; import QuestionCircleFilledIcon from "@ant-design/icons/QuestionCircleFilled"; import { visualizationsSettings } from "@/visualizations/visualizationsSettings"; import "./context-help.less"; -export default function ContextHelp({ icon, children, ...props }) { +type OwnContextHelpProps = { + icon?: React.ReactNode; + children?: React.ReactNode; +}; + +type ContextHelpProps = OwnContextHelpProps & typeof ContextHelp.defaultProps; + +export default function ContextHelp({ icon, children, ...props }: ContextHelpProps) { return ( {icon || ContextHelp.defaultIcon} @@ -14,11 +20,6 @@ export default function ContextHelp({ icon, children, ...props }) { ); } -ContextHelp.propTypes = { - icon: PropTypes.node, - children: PropTypes.node, -}; - ContextHelp.defaultProps = { icon: null, children: null, @@ -30,6 +31,7 @@ function NumberFormatSpecs() { const { HelpTriggerComponent } = visualizationsSettings; return ( {children} @@ -34,11 +44,6 @@ export default function Section({ className, children, ...props }) { ); } -Section.propTypes = { - className: PropTypes.string, - children: PropTypes.node, -}; - Section.defaultProps = { className: null, children: null, diff --git a/viz-lib/src/components/visualizations/editor/Switch.jsx b/viz-lib/src/components/visualizations/editor/Switch.tsx similarity index 76% rename from viz-lib/src/components/visualizations/editor/Switch.jsx rename to viz-lib/src/components/visualizations/editor/Switch.tsx index 0949d66721..6c46cb6260 100644 --- a/viz-lib/src/components/visualizations/editor/Switch.jsx +++ b/viz-lib/src/components/visualizations/editor/Switch.tsx @@ -1,11 +1,19 @@ import React, { useMemo } from "react"; -import PropTypes from "prop-types"; import AntSwitch from "antd/lib/switch"; import Typography from "antd/lib/typography"; import "./Switch.less"; -export default function Switch({ id, children, disabled, ...props }) { +type OwnProps = { + id?: string; + disabled?: boolean; + children?: React.ReactNode; +}; + +type Props = OwnProps & typeof Switch.defaultProps; + +// @ts-expect-error ts-migrate(2700) FIXME: Rest types may only be created from object types. +export default function Switch({ id, children, disabled, ...props }: Props) { const fallbackId = useMemo( () => `visualization-editor-control-${Math.random() @@ -29,12 +37,6 @@ export default function Switch({ id, children, disabled, ...props }) { return ; } -Switch.propTypes = { - id: PropTypes.string, - disabled: PropTypes.bool, - children: PropTypes.node, -}; - Switch.defaultProps = { id: null, disabled: false, diff --git a/viz-lib/src/components/visualizations/editor/TextArea.jsx b/viz-lib/src/components/visualizations/editor/TextArea.tsx similarity index 84% rename from viz-lib/src/components/visualizations/editor/TextArea.jsx rename to viz-lib/src/components/visualizations/editor/TextArea.tsx index 855096dc0a..7660775ff6 100644 --- a/viz-lib/src/components/visualizations/editor/TextArea.jsx +++ b/viz-lib/src/components/visualizations/editor/TextArea.tsx @@ -5,7 +5,10 @@ import withControlLabel from "./withControlLabel"; import "./TextArea.less"; -function TextArea({ className, ...otherProps }) { +function TextArea({ + className, + ...otherProps +}: any) { return ; } diff --git a/viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx b/viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx deleted file mode 100644 index f7c1af612e..0000000000 --- a/viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import { isFunction, map, filter, extend, merge } from "lodash"; -import React from "react"; -import PropTypes from "prop-types"; -import Tabs from "antd/lib/tabs"; -import { EditorPropTypes } from "@/visualizations/prop-types"; - -export const UpdateOptionsStrategy = { - replace: (existingOptions, newOptions) => merge({}, newOptions), - shallowMerge: (existingOptions, newOptions) => extend({}, existingOptions, newOptions), - deepMerge: (existingOptions, newOptions) => merge({}, existingOptions, newOptions), -}; - -export function TabbedEditor({ tabs, options, data, onOptionsChange, ...restProps }) { - const optionsChanged = (newOptions, updateStrategy = UpdateOptionsStrategy.deepMerge) => { - onOptionsChange(updateStrategy(options, newOptions)); - }; - - tabs = filter(tabs, tab => (isFunction(tab.isAvailable) ? tab.isAvailable(options, data) : true)); - - return ( - - {map(tabs, ({ key, title, component: Component }) => ( - {isFunction(title) ? title(options) : title}}> - - - ))} - - ); -} - -TabbedEditor.propTypes = { - ...EditorPropTypes, - tabs: PropTypes.arrayOf( - PropTypes.shape({ - key: PropTypes.string.isRequired, - title: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.func, // (options) => string - ]).isRequired, - isAvailable: PropTypes.func, // (options) => boolean - component: PropTypes.func.isRequired, - }) - ), -}; - -TabbedEditor.defaultProps = { - tabs: [], -}; - -export default function createTabbedEditor(tabs) { - return function TabbedEditorWrapper(props) { - return ; - }; -} diff --git a/viz-lib/src/components/visualizations/editor/createTabbedEditor.tsx b/viz-lib/src/components/visualizations/editor/createTabbedEditor.tsx new file mode 100644 index 0000000000..5507d3cdc6 --- /dev/null +++ b/viz-lib/src/components/visualizations/editor/createTabbedEditor.tsx @@ -0,0 +1,57 @@ +import { isFunction, map, filter, extend, merge } from "lodash"; +import React from "react"; +import Tabs from "antd/lib/tabs"; +import { EditorPropTypes } from "@/visualizations/prop-types"; + +export const UpdateOptionsStrategy = { + replace: (existingOptions: any, newOptions: any) => merge({}, newOptions), + shallowMerge: (existingOptions: any, newOptions: any) => extend({}, existingOptions, newOptions), + deepMerge: (existingOptions: any, newOptions: any) => merge({}, existingOptions, newOptions), +}; + +/* +(ts-migrate) TODO: Migrate the remaining prop types +...EditorPropTypes +*/ +type OwnProps = { + tabs?: { + key: string; + title: string | ((...args: any[]) => any); + isAvailable?: (...args: any[]) => any; + component: (...args: any[]) => any; + }[]; +}; + +type Props = OwnProps & typeof TabbedEditor.defaultProps; + +// @ts-expect-error ts-migrate(2339) FIXME: Property 'options' does not exist on type 'Props'. +export function TabbedEditor({ tabs, options, data, onOptionsChange, ...restProps }: Props) { + const optionsChanged = (newOptions: any, updateStrategy = UpdateOptionsStrategy.deepMerge) => { + onOptionsChange(updateStrategy(options, newOptions)); + }; + + // @ts-expect-error ts-migrate(2322) FIXME: Type '(number | ((() => string) & (() => string)) ... Remove this comment to see the full error message + tabs = filter(tabs, tab => (isFunction(tab.isAvailable) ? tab.isAvailable(options, data) : true)); + + return ( + + {map(tabs, ({ key, title, component: Component }) => ( + {isFunction(title) ? title(options) : title}}> + + + ))} + + ); +} + +TabbedEditor.defaultProps = { + tabs: [], +}; + +export default function createTabbedEditor(tabs: any) { + return function TabbedEditorWrapper(props: any) { + return ; + }; +} diff --git a/viz-lib/src/components/visualizations/editor/index.js b/viz-lib/src/components/visualizations/editor/index.ts similarity index 100% rename from viz-lib/src/components/visualizations/editor/index.js rename to viz-lib/src/components/visualizations/editor/index.ts diff --git a/viz-lib/src/components/visualizations/editor/withControlLabel.jsx b/viz-lib/src/components/visualizations/editor/withControlLabel.tsx similarity index 72% rename from viz-lib/src/components/visualizations/editor/withControlLabel.jsx rename to viz-lib/src/components/visualizations/editor/withControlLabel.tsx index a28f2bc255..6c90ea0065 100644 --- a/viz-lib/src/components/visualizations/editor/withControlLabel.jsx +++ b/viz-lib/src/components/visualizations/editor/withControlLabel.tsx @@ -1,13 +1,22 @@ import React, { useMemo } from "react"; import cx from "classnames"; -import PropTypes from "prop-types"; import hoistNonReactStatics from "hoist-non-react-statics"; import * as Grid from "antd/lib/grid"; import Typography from "antd/lib/typography"; import "./control-label.less"; -export function ControlLabel({ layout, label, labelProps, disabled, children }) { +type OwnProps = { + layout?: "vertical" | "horizontal"; + label?: React.ReactNode; + labelProps?: any; + disabled?: boolean; + children?: React.ReactNode; +}; + +type Props = OwnProps & typeof ControlLabel.defaultProps; + +export function ControlLabel({ layout, label, labelProps, disabled, children }: Props) { if (layout === "vertical" && label) { return (
@@ -23,6 +32,7 @@ export function ControlLabel({ layout, label, labelProps, disabled, children }) return ( @@ -39,14 +49,6 @@ export function ControlLabel({ layout, label, labelProps, disabled, children }) return children; } -ControlLabel.propTypes = { - layout: PropTypes.oneOf(["vertical", "horizontal"]), - label: PropTypes.node, - labelProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types - disabled: PropTypes.bool, - children: PropTypes.node, -}; - ControlLabel.defaultProps = { layout: "vertical", label: null, @@ -54,9 +56,17 @@ ControlLabel.defaultProps = { children: null, }; -export default function withControlLabel(WrappedControl) { +export default function withControlLabel(WrappedControl: any) { // eslint-disable-next-line react/prop-types - function ControlWrapper({ className, id, layout, label, labelProps, disabled, ...props }) { + function ControlWrapper({ + className, + id, + layout, + label, + labelProps, + disabled, + ...props + }: any) { const fallbackId = useMemo( () => `visualization-editor-control-${Math.random() @@ -71,6 +81,7 @@ export default function withControlLabel(WrappedControl) { return ( + {/* @ts-expect-error ts-migrate(2322) FIXME: Type 'Element' is not assignable to type 'null | u... Remove this comment to see the full error message */} chroma.contrast(backgroundColor, color)); diff --git a/viz-lib/src/lib/hooks/useMemoWithDeepCompare.js b/viz-lib/src/lib/hooks/useMemoWithDeepCompare.ts similarity index 52% rename from viz-lib/src/lib/hooks/useMemoWithDeepCompare.js rename to viz-lib/src/lib/hooks/useMemoWithDeepCompare.ts index 381253cae8..a42adfe173 100644 --- a/viz-lib/src/lib/hooks/useMemoWithDeepCompare.js +++ b/viz-lib/src/lib/hooks/useMemoWithDeepCompare.ts @@ -1,10 +1,11 @@ import { isEqual } from "lodash"; import { useMemo, useRef } from "react"; -export default function useMemoWithDeepCompare(create, inputs) { +export default function useMemoWithDeepCompare(create: any, inputs: any) { const valueRef = useRef(); const value = useMemo(create, inputs); if (!isEqual(value, valueRef.current)) { + // @ts-expect-error ts-migrate(2322) FIXME: Type 'unknown' is not assignable to type 'undefine... Remove this comment to see the full error message valueRef.current = value; } return valueRef.current; diff --git a/viz-lib/src/lib/referenceCountingCache.js b/viz-lib/src/lib/referenceCountingCache.js deleted file mode 100644 index 35ff4721d0..0000000000 --- a/viz-lib/src/lib/referenceCountingCache.js +++ /dev/null @@ -1,39 +0,0 @@ -import { each, debounce } from "lodash"; - -export default function createReferenceCountingCache({ cleanupDelay = 2000 } = {}) { - const items = {}; - - const cleanup = debounce(() => { - each(items, (item, key) => { - if (item.refCount <= 0) { - delete items[key]; - } - }); - }, cleanupDelay); - - function get(key, getter) { - if (!items[key]) { - items[key] = { - value: getter(), - refCount: 0, - }; - } - const item = items[key]; - item.refCount += 1; - return item.value; - } - - function release(key) { - if (items[key]) { - const item = items[key]; - if (item.refCount > 0) { - item.refCount -= 1; - if (item.refCount <= 0) { - cleanup(); - } - } - } - } - - return { get, release }; -} diff --git a/viz-lib/src/lib/referenceCountingCache.ts b/viz-lib/src/lib/referenceCountingCache.ts new file mode 100644 index 0000000000..778acff2ea --- /dev/null +++ b/viz-lib/src/lib/referenceCountingCache.ts @@ -0,0 +1,46 @@ +import { each, debounce } from "lodash"; + +export default function createReferenceCountingCache({ cleanupDelay = 2000 } = {}) { + const items = {}; + + const cleanup = debounce(() => { + each(items, (item, key) => { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'refCount' does not exist on type 'never'... Remove this comment to see the full error message + if (item.refCount <= 0) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + delete items[key]; + } + }); + }, cleanupDelay); + + function get(key: any, getter: any) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + if (!items[key]) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + items[key] = { + value: getter(), + refCount: 0, + }; + } + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + const item = items[key]; + item.refCount += 1; + return item.value; + } + + function release(key: any) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + if (items[key]) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + const item = items[key]; + if (item.refCount > 0) { + item.refCount -= 1; + if (item.refCount <= 0) { + cleanup(); + } + } + } + } + + return { get, release }; +} diff --git a/viz-lib/src/lib/utils.js b/viz-lib/src/lib/utils.ts similarity index 83% rename from viz-lib/src/lib/utils.js rename to viz-lib/src/lib/utils.ts index 4bec7433e3..ffca8731a3 100644 --- a/viz-lib/src/lib/utils.js +++ b/viz-lib/src/lib/utils.ts @@ -1,7 +1,7 @@ import moment from "moment"; import { visualizationsSettings } from "@/visualizations/visualizationsSettings"; -function formatDateTime(value) { +function formatDateTime(value: any) { if (!value) { return ""; } @@ -14,7 +14,7 @@ function formatDateTime(value) { return parsed.format(visualizationsSettings.dateTimeFormat); } -function formatDate(value) { +function formatDate(value: any) { if (!value) { return ""; } @@ -27,7 +27,7 @@ function formatDate(value) { return parsed.format(visualizationsSettings.dateFormat); } -export function formatColumnValue(value, columnType = null) { +export function formatColumnValue(value: any, columnType = null) { if (moment.isMoment(value)) { if (columnType === "date") { return formatDate(value); diff --git a/viz-lib/src/lib/value-format.jsx b/viz-lib/src/lib/value-format.tsx similarity index 75% rename from viz-lib/src/lib/value-format.jsx rename to viz-lib/src/lib/value-format.tsx index 0d8de19094..8eb4c0dc17 100644 --- a/viz-lib/src/lib/value-format.jsx +++ b/viz-lib/src/lib/value-format.tsx @@ -12,9 +12,9 @@ const urlPattern = /(^|[\s\n]|)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019 const hasOwnProperty = Object.prototype.hasOwnProperty; -export function createTextFormatter(highlightLinks) { +export function createTextFormatter(highlightLinks: any) { if (highlightLinks) { - return value => { + return (value: any) => { if (isString(value)) { const Link = visualizationsSettings.LinkComponent; value = value.replace(urlPattern, (unused, prefix, href) => { @@ -29,10 +29,10 @@ export function createTextFormatter(highlightLinks) { return toString(value); }; } - return value => toString(value); + return (value: any) => toString(value); } -function toMoment(value) { +function toMoment(value: any) { if (moment.isMoment(value)) { return value; } @@ -43,21 +43,21 @@ function toMoment(value) { return moment(toString(value), [moment.ISO_8601, moment.RFC_2822]); } -export function createDateTimeFormatter(format) { +export function createDateTimeFormatter(format: any) { if (isString(format) && format !== "") { - return value => { + return (value: any) => { const wrapped = toMoment(value); return wrapped.isValid() ? wrapped.format(format) : toString(value); }; } - return value => toString(value); + return (value: any) => toString(value); } -export function createBooleanFormatter(values) { +export function createBooleanFormatter(values: any) { if (isArray(values)) { if (values.length >= 2) { // Both `true` and `false` specified - return value => { + return (value: any) => { if (isNil(value)) { return ""; } @@ -65,10 +65,10 @@ export function createBooleanFormatter(values) { }; } else if (values.length === 1) { // Only `true` - return value => (value ? values[0] : ""); + return (value: any) => value ? values[0] : ""; } } - return value => { + return (value: any) => { if (isNil(value)) { return ""; } @@ -76,15 +76,15 @@ export function createBooleanFormatter(values) { }; } -export function createNumberFormatter(format) { +export function createNumberFormatter(format: any) { if (isString(format) && format !== "") { const n = numeral(0); // cache `numeral` instance - return value => (value === null || value === "" ? "" : n.set(value).format(format)); + return (value: any) => value === null || value === "" ? "" : n.set(value).format(format); } - return value => toString(value); + return (value: any) => toString(value); } -export function formatSimpleTemplate(str, data) { +export function formatSimpleTemplate(str: any, data: any) { if (!isString(str)) { return ""; } diff --git a/viz-lib/src/services/resizeObserver.js b/viz-lib/src/services/resizeObserver.ts similarity index 92% rename from viz-lib/src/services/resizeObserver.js rename to viz-lib/src/services/resizeObserver.ts index c27b3bbae2..b1825e8b3a 100644 --- a/viz-lib/src/services/resizeObserver.js +++ b/viz-lib/src/services/resizeObserver.ts @@ -19,7 +19,7 @@ function checkItems() { } } -export default function observe(node, callback) { +export default function observe(node: any, callback: any) { if (node && !items.has(node)) { const shouldTrigger = items.size === 0; items.set(node, { callback }); diff --git a/viz-lib/src/services/sanitize.js b/viz-lib/src/services/sanitize.ts similarity index 100% rename from viz-lib/src/services/sanitize.js rename to viz-lib/src/services/sanitize.ts diff --git a/viz-lib/src/visualizations/ColorPalette.js b/viz-lib/src/visualizations/ColorPalette.ts similarity index 100% rename from viz-lib/src/visualizations/ColorPalette.js rename to viz-lib/src/visualizations/ColorPalette.ts diff --git a/viz-lib/src/visualizations/Editor.jsx b/viz-lib/src/visualizations/Editor.tsx similarity index 59% rename from viz-lib/src/visualizations/Editor.jsx rename to viz-lib/src/visualizations/Editor.tsx index 1d78ce0685..85fce08da7 100644 --- a/viz-lib/src/visualizations/Editor.jsx +++ b/viz-lib/src/visualizations/Editor.tsx @@ -1,16 +1,19 @@ import React, { useMemo } from "react"; -import PropTypes from "prop-types"; import { EditorPropTypes } from "@/visualizations/prop-types"; import registeredVisualizations from "@/visualizations/registeredVisualizations"; -export default function Editor({ type, options: optionsProp, data, ...otherProps }) { +/* +(ts-migrate) TODO: Migrate the remaining prop types +...EditorPropTypes +*/ +type Props = { + type: string; +} & typeof EditorPropTypes; + +export default function Editor({ type, options: optionsProp, data, ...otherProps }: Props) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message const { Editor, getOptions } = registeredVisualizations[type]; const options = useMemo(() => getOptions(optionsProp, data), [optionsProp, data]); return ; } - -Editor.propTypes = { - type: PropTypes.string.isRequired, - ...EditorPropTypes, -}; diff --git a/viz-lib/src/visualizations/Renderer.jsx b/viz-lib/src/visualizations/Renderer.tsx similarity index 69% rename from viz-lib/src/visualizations/Renderer.jsx rename to viz-lib/src/visualizations/Renderer.tsx index 3bd005f9f6..781fcbbab8 100644 --- a/viz-lib/src/visualizations/Renderer.jsx +++ b/viz-lib/src/visualizations/Renderer.tsx @@ -1,22 +1,24 @@ import { isEqual } from "lodash"; import React, { useEffect, useRef } from "react"; -import PropTypes from "prop-types"; import ErrorBoundary, { ErrorMessage } from "@/components/ErrorBoundary"; import { RendererPropTypes } from "@/visualizations/prop-types"; import registeredVisualizations from "@/visualizations/registeredVisualizations"; -export default function Renderer({ - type, - data, - options: optionsProp, - visualizationName, - addonBefore, - addonAfter, - ...otherProps -}) { +/* +(ts-migrate) TODO: Migrate the remaining prop types +...RendererPropTypes +*/ +type Props = { + type: string; + addonBefore?: React.ReactNode; + addonAfter?: React.ReactNode; +} & typeof RendererPropTypes; + +export default function Renderer({ type, data, options: optionsProp, visualizationName, addonBefore, addonAfter, ...otherProps }: Props) { const lastOptions = useRef(); const errorHandlerRef = useRef(); + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message const { Renderer, getOptions } = registeredVisualizations[type]; // Avoid unnecessary updates (which may be expensive or cause issues with @@ -31,6 +33,7 @@ export default function Renderer({ useEffect(() => { if (errorHandlerRef.current) { + // @ts-expect-error ts-migrate(2532) FIXME: Object is possibly 'undefined'. errorHandlerRef.current.reset(); } }, [optionsProp, data]); @@ -38,6 +41,7 @@ export default function Renderer({ return (
{addonBefore} + {/* @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. */} Error while rendering visualization.}> @@ -49,10 +53,3 @@ export default function Renderer({
); } - -Renderer.propTypes = { - type: PropTypes.string.isRequired, - addonBefore: PropTypes.node, - addonAfter: PropTypes.node, - ...RendererPropTypes, -}; diff --git a/viz-lib/src/visualizations/box-plot/Editor.jsx b/viz-lib/src/visualizations/box-plot/Editor.tsx similarity index 54% rename from viz-lib/src/visualizations/box-plot/Editor.jsx rename to viz-lib/src/visualizations/box-plot/Editor.tsx index 02155a84c8..b17fa3f0c3 100644 --- a/viz-lib/src/visualizations/box-plot/Editor.jsx +++ b/viz-lib/src/visualizations/box-plot/Editor.tsx @@ -2,34 +2,39 @@ import React from "react"; import { Section, Input } from "@/components/visualizations/editor"; import { EditorPropTypes } from "@/visualizations/prop-types"; -export default function Editor({ options, onOptionsChange }) { - const onXAxisLabelChanged = xAxisLabel => { +export default function Editor({ + options, + onOptionsChange +}: any) { + const onXAxisLabelChanged = (xAxisLabel: any) => { const newOptions = { ...options, xAxisLabel }; onOptionsChange(newOptions); }; - const onYAxisLabelChanged = yAxisLabel => { + const onYAxisLabelChanged = (yAxisLabel: any) => { const newOptions = { ...options, yAxisLabel }; onOptionsChange(newOptions); }; return ( + {/* @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */}
onXAxisLabelChanged(event.target.value)} + onChange={(event: any) => onXAxisLabelChanged(event.target.value)} />
+ {/* @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */}
onYAxisLabelChanged(event.target.value)} + onChange={(event: any) => onYAxisLabelChanged(event.target.value)} />
diff --git a/viz-lib/src/visualizations/box-plot/Renderer.jsx b/viz-lib/src/visualizations/box-plot/Renderer.tsx similarity index 73% rename from viz-lib/src/visualizations/box-plot/Renderer.jsx rename to viz-lib/src/visualizations/box-plot/Renderer.tsx index f6343a8fb2..e825cc988c 100644 --- a/viz-lib/src/visualizations/box-plot/Renderer.jsx +++ b/viz-lib/src/visualizations/box-plot/Renderer.tsx @@ -6,8 +6,8 @@ import { RendererPropTypes } from "@/visualizations/prop-types"; import box from "./d3box"; import "./renderer.less"; -function calcIqr(k) { - return d => { +function calcIqr(k: any) { + return (d: any) => { const q1 = d.quartiles[0]; const q3 = d.quartiles[2]; const iqr = (q3 - q1) * k; @@ -29,7 +29,10 @@ function calcIqr(k) { }; } -function render(container, data, { xAxisLabel, yAxisLabel }) { +function render(container: any, data: any, { + xAxisLabel, + yAxisLabel +}: any) { container = d3.select(container); const containerBounds = container.node().getBoundingClientRect(); @@ -48,11 +51,12 @@ function render(container, data, { xAxisLabel, yAxisLabel }) { let min = Infinity; let max = -Infinity; - const mydata = []; + const mydata: any = []; let value = 0; let d = []; const columns = map(data.columns, col => col.name); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'scale' does not exist on type 'typeof im... Remove this comment to see the full error message const xscale = d3.scale .ordinal() .domain(columns) @@ -76,6 +80,7 @@ function render(container, data, { xAxisLabel, yAxisLabel }) { }); }); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'scale' does not exist on type 'typeof im... Remove this comment to see the full error message const yscale = d3.scale .linear() .domain([min * 0.99, max * 1.01]) @@ -83,32 +88,37 @@ function render(container, data, { xAxisLabel, yAxisLabel }) { const chart = box() .whiskers(calcIqr(1.5)) + // @ts-expect-error ts-migrate(2339) FIXME: Property 'width' does not exist on type '{ (g: any... Remove this comment to see the full error message .width(boxWidth - 2 * margin.inner) .height(height) .domain([min * 0.99, max * 1.01]); const xAxis = d3.svg + // @ts-expect-error ts-migrate(2339) FIXME: Property 'axis' does not exist on type '(url: stri... Remove this comment to see the full error message .axis() .scale(xscale) .orient("bottom"); const yAxis = d3.svg + // @ts-expect-error ts-migrate(2339) FIXME: Property 'axis' does not exist on type '(url: stri... Remove this comment to see the full error message .axis() .scale(yscale) .orient("left"); const xLines = d3.svg + // @ts-expect-error ts-migrate(2339) FIXME: Property 'axis' does not exist on type '(url: stri... Remove this comment to see the full error message .axis() .scale(xscale) .tickSize(height) .orient("bottom"); const yLines = d3.svg + // @ts-expect-error ts-migrate(2339) FIXME: Property 'axis' does not exist on type '(url: stri... Remove this comment to see the full error message .axis() .scale(yscale) .tickSize(width) .orient("right"); - function barOffset(i) { + function barOffset(i: any) { return xscale(columns[i]) + (xscale(columns[1]) - margin.inner) / 2.0; } @@ -174,11 +184,14 @@ function render(container, data, { xAxisLabel, yAxisLabel }) { .attr("class", "box") .attr("width", boxWidth) .attr("height", height) - .attr("transform", (_, i) => `translate(${barOffset(i)},${0})`) + .attr("transform", (_: any, i: any) => `translate(${barOffset(i)},${0})`) .call(chart); } -export default function Renderer({ data, options }) { +export default function Renderer({ + data, + options +}: any) { const [container, setContainer] = useState(null); useEffect(() => { @@ -191,6 +204,7 @@ export default function Renderer({ data, options }) { } }, [container, data, options]); + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Dispatch>' is not assig... Remove this comment to see the full error message return
; } diff --git a/viz-lib/src/visualizations/box-plot/d3box.js b/viz-lib/src/visualizations/box-plot/d3box.ts similarity index 78% rename from viz-lib/src/visualizations/box-plot/d3box.js rename to viz-lib/src/visualizations/box-plot/d3box.ts index 41a27b9ea9..c5f9eae5dd 100644 --- a/viz-lib/src/visualizations/box-plot/d3box.js +++ b/viz-lib/src/visualizations/box-plot/d3box.ts @@ -4,16 +4,17 @@ function box() { let width = 1, height = 1, duration = 0, - domain = null, + domain: any = null, value = Number, whiskers = boxWhiskers, quartiles = boxQuartiles, - tickFormat = null; + tickFormat: any = null; // For each small multiple… - function box(g) { - g.each(function(d, i) { + function box(g: any) { + g.each(function(d: any, i: any) { d = d.map(value).sort(d3.ascending); + // @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message let g = d3.select(this), n = d.length, min = d[0], @@ -23,6 +24,7 @@ function box() { const quartileData = (d.quartiles = quartiles(d)); // Compute whiskers. Must return exactly 2 elements, or null. + // @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message let whiskerIndices = whiskers && whiskers.call(this, d, i), whiskerData = whiskerIndices && whiskerIndices.map(i => d[i]); @@ -33,20 +35,25 @@ function box() { : d3.range(n); // Compute the new x-scale. + // @ts-expect-error ts-migrate(2339) FIXME: Property 'scale' does not exist on type 'typeof im... Remove this comment to see the full error message const x1 = d3.scale .linear() + // @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message .domain((domain && domain.call(this, d, i)) || [min, max]) .range([height, 0]); // Retrieve the old x-scale, if this is an update. const x0 = + // @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message this.__chart__ || + // @ts-expect-error ts-migrate(2339) FIXME: Property 'scale' does not exist on type 'typeof im... Remove this comment to see the full error message d3.scale .linear() .domain([0, Infinity]) .range(x1.range()); // Stash the new scale. + // @ts-expect-error ts-migrate(2683) FIXME: 'this' implicitly has type 'any' because it does n... Remove this comment to see the full error message this.__chart__ = x1; // Note: the box, median, and box tick elements are fixed in number, @@ -84,7 +91,9 @@ function box() { .transition() .duration(duration) .style("opacity", 1e-6) + // @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'. .attr("y1", d => x1(d[0])) + // @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'. .attr("y2", d => x1(d[1])) .remove(); @@ -196,6 +205,7 @@ function box() { .exit() .transition() .duration(duration) + // @ts-expect-error ts-migrate(2538) FIXME: Type 'unknown' cannot be used as an index type. .attr("cy", i => x1(d[i])) .style("opacity", 1e-6) .remove(); @@ -263,52 +273,54 @@ function box() { .style("opacity", 1e-6) .remove(); }); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'flush' does not exist on type '(callback... Remove this comment to see the full error message d3.timer.flush(); } - box.width = function(x) { + box.width = function(x: any) { if (!arguments.length) return width; width = x; return box; }; - box.height = function(x) { + box.height = function(x: any) { if (!arguments.length) return height; height = x; return box; }; - box.tickFormat = function(x) { + box.tickFormat = function(x: any) { if (!arguments.length) return tickFormat; tickFormat = x; return box; }; - box.duration = function(x) { + box.duration = function(x: any) { if (!arguments.length) return duration; duration = x; return box; }; - box.domain = function(x) { + box.domain = function(x: any) { if (!arguments.length) return domain; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'functor' does not exist on type 'typeof ... Remove this comment to see the full error message domain = x == null ? x : d3.functor(x); return box; }; - box.value = function(x) { + box.value = function(x: any) { if (!arguments.length) return value; value = x; return box; }; - box.whiskers = function(x) { + box.whiskers = function(x: any) { if (!arguments.length) return whiskers; whiskers = x; return box; }; - box.quartiles = function(x) { + box.quartiles = function(x: any) { if (!arguments.length) return quartiles; quartiles = x; return box; @@ -317,11 +329,11 @@ function box() { return box; } -function boxWhiskers(d) { +function boxWhiskers(d: any) { return [0, d.length - 1]; } -function boxQuartiles(d) { +function boxQuartiles(d: any) { return [d3.quantile(d, 0.25), d3.quantile(d, 0.5), d3.quantile(d, 0.75)]; } diff --git a/viz-lib/src/visualizations/box-plot/index.js b/viz-lib/src/visualizations/box-plot/index.ts similarity index 79% rename from viz-lib/src/visualizations/box-plot/index.js rename to viz-lib/src/visualizations/box-plot/index.ts index d65e24f081..de82aa5ef6 100644 --- a/viz-lib/src/visualizations/box-plot/index.js +++ b/viz-lib/src/visualizations/box-plot/index.ts @@ -5,7 +5,9 @@ export default { type: "BOXPLOT", name: "Boxplot (Deprecated)", isDeprecated: true, - getOptions: options => ({ ...options }), + getOptions: (options: any) => ({ + ...options + }), Renderer, Editor, diff --git a/viz-lib/src/visualizations/chart/Editor/AxisSettings.jsx b/viz-lib/src/visualizations/chart/Editor/AxisSettings.jsx deleted file mode 100644 index 6f018a8e59..0000000000 --- a/viz-lib/src/visualizations/chart/Editor/AxisSettings.jsx +++ /dev/null @@ -1,110 +0,0 @@ -import { isString, isObject, isFinite, isNumber, merge } from "lodash"; -import React from "react"; -import PropTypes from "prop-types"; -import { useDebouncedCallback } from "use-debounce"; -import * as Grid from "antd/lib/grid"; -import { Section, Select, Input, InputNumber } from "@/components/visualizations/editor"; - -function toNumber(value) { - value = isNumber(value) ? value : parseFloat(value); - return isFinite(value) ? value : null; -} - -export default function AxisSettings({ id, options, features, onChange }) { - function optionsChanged(newOptions) { - onChange(merge({}, options, newOptions)); - } - - const [handleNameChange] = useDebouncedCallback(text => { - const title = isString(text) && text !== "" ? { text } : null; - optionsChanged({ title }); - }, 200); - - const [handleMinMaxChange] = useDebouncedCallback(opts => optionsChanged(opts), 200); - - return ( - -
- -
- -
- handleNameChange(event.target.value)} - /> -
- - {features.range && ( -
- - - handleMinMaxChange({ rangeMin: toNumber(value) })} - /> - - - handleMinMaxChange({ rangeMax: toNumber(value) })} - /> - - -
- )} -
- ); -} - -AxisSettings.propTypes = { - id: PropTypes.string.isRequired, - options: PropTypes.shape({ - type: PropTypes.string.isRequired, - title: PropTypes.shape({ - text: PropTypes.string, - }), - rangeMin: PropTypes.number, - rangeMax: PropTypes.number, - }).isRequired, - features: PropTypes.shape({ - autoDetectType: PropTypes.bool, - range: PropTypes.bool, - }), - onChange: PropTypes.func, -}; - -AxisSettings.defaultProps = { - features: {}, - onChange: () => {}, -}; diff --git a/viz-lib/src/visualizations/chart/Editor/AxisSettings.tsx b/viz-lib/src/visualizations/chart/Editor/AxisSettings.tsx new file mode 100644 index 0000000000..9b5734f0a7 --- /dev/null +++ b/viz-lib/src/visualizations/chart/Editor/AxisSettings.tsx @@ -0,0 +1,125 @@ +import { isString, isObject, isFinite, isNumber, merge } from "lodash"; +import React from "react"; +import { useDebouncedCallback } from "use-debounce"; +import * as Grid from "antd/lib/grid"; +import { Section, Select, Input, InputNumber } from "@/components/visualizations/editor"; + +function toNumber(value: any) { + value = isNumber(value) ? value : parseFloat(value); + return isFinite(value) ? value : null; +} + +type OwnProps = { + id: string; + options: { + type: string; + title?: { + text?: string; + }; + rangeMin?: number; + rangeMax?: number; + }; + features?: { + autoDetectType?: boolean; + range?: boolean; + }; + onChange?: (...args: any[]) => any; +}; + +type Props = OwnProps & typeof AxisSettings.defaultProps; + +export default function AxisSettings({ id, options, features, onChange }: Props) { + function optionsChanged(newOptions: any) { + onChange(merge({}, options, newOptions)); + } + + const [handleNameChange] = useDebouncedCallback(text => { + const title = isString(text) && text !== "" ? { text } : null; + optionsChanged({ title }); + }, 200); + + const [handleMinMaxChange] = useDebouncedCallback(opts => optionsChanged(opts), 200); + + return ( + + {/* @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} +
+ +
+ + {/* @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} +
+ handleNameChange(event.target.value)} + /> +
+ + {features.range && ( + // @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message +
+ {/* @ts-expect-error ts-migrate(2322) FIXME: Type '{ children: Element[]; gutter: number; type:... Remove this comment to see the full error message */} + + + handleMinMaxChange({ rangeMin: toNumber(value) })} + /> + + + handleMinMaxChange({ rangeMax: toNumber(value) })} + /> + + +
+ )} +
+ ); +} + +AxisSettings.defaultProps = { + features: {}, + onChange: () => {}, +}; diff --git a/viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.jsx b/viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.tsx similarity index 75% rename from viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.jsx rename to viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.tsx index dbc978d003..04d4d6578a 100644 --- a/viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.jsx +++ b/viz-lib/src/visualizations/chart/Editor/ChartTypeSelect.tsx @@ -1,6 +1,5 @@ import { filter, includes, map } from "lodash"; import React, { useMemo } from "react"; -import PropTypes from "prop-types"; import { Select } from "@/components/visualizations/editor"; import { visualizationsSettings } from "@/visualizations/visualizationsSettings"; @@ -15,7 +14,13 @@ const allChartTypes = [ { type: "box", name: "Box", icon: "square-o" }, ]; -export default function ChartTypeSelect({ hiddenChartTypes, ...props }) { +type OwnProps = { + hiddenChartTypes?: any[]; // TODO: PropTypes.oneOf(map(allChartTypes, "type")) +}; + +type Props = OwnProps & typeof ChartTypeSelect.defaultProps; + +export default function ChartTypeSelect({ hiddenChartTypes, ...props }: Props) { const chartTypes = useMemo(() => { const result = [...allChartTypes]; @@ -33,19 +38,17 @@ export default function ChartTypeSelect({ hiddenChartTypes, ...props }) { return ( ); } -ChartTypeSelect.propTypes = { - hiddenChartTypes: PropTypes.arrayOf(PropTypes.oneOf(map(allChartTypes, "type"))), -}; - ChartTypeSelect.defaultProps = { hiddenChartTypes: [], }; diff --git a/viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.js b/viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.tsx similarity index 95% rename from viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.js rename to viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.tsx index 499aba83e2..393ae1bf32 100644 --- a/viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.js +++ b/viz-lib/src/visualizations/chart/Editor/ColorsSettings.test.tsx @@ -5,11 +5,11 @@ import enzyme from "enzyme"; import getOptions from "../getOptions"; import ColorsSettings from "./ColorsSettings"; -function findByTestID(wrapper, testId) { +function findByTestID(wrapper: any, testId: any) { return wrapper.find(`[data-test="${testId}"]`); } -function mount(options, done) { +function mount(options: any, done: any) { options = getOptions(options); return enzyme.mount( { + onOptionsChange={(changedOptions: any) => { expect(changedOptions).toMatchSnapshot(); done(); }} diff --git a/viz-lib/src/visualizations/chart/Editor/ColorsSettings.jsx b/viz-lib/src/visualizations/chart/Editor/ColorsSettings.tsx similarity index 70% rename from viz-lib/src/visualizations/chart/Editor/ColorsSettings.jsx rename to viz-lib/src/visualizations/chart/Editor/ColorsSettings.tsx index 0a1d3e36cb..543093da25 100644 --- a/viz-lib/src/visualizations/chart/Editor/ColorsSettings.jsx +++ b/viz-lib/src/visualizations/chart/Editor/ColorsSettings.tsx @@ -10,7 +10,11 @@ const components = { heatmap: HeatmapColorsSettings, }; -export default function ColorsSettings({ options, ...props }) { +export default function ColorsSettings({ + options, + ...props +}: any) { + // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message const Component = components[options.globalSeriesType] || DefaultColorsSettings; return ; } diff --git a/viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.jsx b/viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.tsx similarity index 62% rename from viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.jsx rename to viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.tsx index b455848c50..e07f77d1f3 100644 --- a/viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.jsx +++ b/viz-lib/src/visualizations/chart/Editor/ColumnMappingSelect.tsx @@ -1,6 +1,5 @@ import { isString, map, uniq, flatten, filter, sortBy, keys } from "lodash"; import React from "react"; -import PropTypes from "prop-types"; import { Section, Select } from "@/components/visualizations/editor"; const MappingTypes = { @@ -18,13 +17,23 @@ const SwappedMappingTypes = { y: { label: "X Columns", multiple: true }, }; -export default function ColumnMappingSelect({ value, availableColumns, type, onChange, areAxesSwapped }) { +type OwnProps = { + value?: string | string[]; + availableColumns?: string[]; + type?: any; // TODO: PropTypes.oneOf(keys(MappingTypes)) + onChange?: (...args: any[]) => any; +}; + +type Props = OwnProps & typeof ColumnMappingSelect.defaultProps; + +export default function ColumnMappingSelect({ value, availableColumns, type, onChange, areAxesSwapped }: Props) { const options = sortBy(filter(uniq(flatten([availableColumns, value])), v => isString(v) && v !== "")); // this swaps the ui, as the data will be swapped on render const { label, multiple } = !areAxesSwapped ? MappingTypes[type] : SwappedMappingTypes[type]; return ( + // @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message
@@ -45,13 +57,6 @@ export default function ColumnMappingSelect({ value, availableColumns, type, onC ); } -ColumnMappingSelect.propTypes = { - value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), - availableColumns: PropTypes.arrayOf(PropTypes.string), - type: PropTypes.oneOf(keys(MappingTypes)), - onChange: PropTypes.func, -}; - ColumnMappingSelect.defaultProps = { value: null, availableColumns: [], diff --git a/viz-lib/src/visualizations/chart/Editor/CustomChartSettings.jsx b/viz-lib/src/visualizations/chart/Editor/CustomChartSettings.jsx deleted file mode 100644 index 522c6f103e..0000000000 --- a/viz-lib/src/visualizations/chart/Editor/CustomChartSettings.jsx +++ /dev/null @@ -1,48 +0,0 @@ -import { isNil, trimStart } from "lodash"; -import React from "react"; -import { Section, Switch, TextArea } from "@/components/visualizations/editor"; -import { EditorPropTypes } from "@/visualizations/prop-types"; - -const defaultCustomCode = trimStart(` -// Available variables are x, ys, element, and Plotly -// Type console.log(x, ys); for more info about x and ys -// To plot your graph call Plotly.plot(element, ...) -// Plotly examples and docs: https://plot.ly/javascript/ -`); - -export default function CustomChartSettings({ options, onOptionsChange }) { - return ( - -
-