From 6521c8055ccb11274b3e29c30ef246dbd8fdd3ca Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 27 Aug 2024 21:22:16 +0200 Subject: [PATCH 01/13] set codecov token from secrets --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eaefe652..f5afb7d5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,4 +23,5 @@ jobs: uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 with: flags: unittests + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true From 7bca541cb66a060f6da5b7e4de0db0661f09ba9c Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 27 Aug 2024 20:06:57 -0400 Subject: [PATCH 02/13] Perform dead code analysis with Knip (#2575) * Install Knip * Clarify an import that was confusing Knip * Fix issues detected by Knip Including cleaning up some unused code and dependencies, using a React hook that we unintentionally stopped using, and also adding some previously undeclared dependencies. * Run dead code analysis in lint script and CI --------- Co-authored-by: Timo --- .github/workflows/lint.yaml | 2 + .github/workflows/test.yaml | 3 +- knip.ts | 30 ++ package.json | 109 +++--- renovate.json | 11 +- src/Banner.tsx | 27 -- src/home/RegisteredView.tsx | 7 +- src/home/UnauthenticatedView.tsx | 7 +- src/livekit/LivekitFocus.ts | 0 src/room/RoomPage.tsx | 7 +- src/room/usePageUnload.ts | 64 ---- src/settings/SettingsModal.tsx | 4 +- src/useEvents.ts | 18 - src/useLocalStorage.ts | 3 - src/usePrevious.ts | 27 -- src/utils/array.ts | 44 --- src/utils/matrix.ts | 32 -- src/widget.ts | 21 -- vitest.config.js | 2 +- yarn.lock | 627 ++++++++----------------------- 20 files changed, 271 insertions(+), 774 deletions(-) create mode 100644 knip.ts delete mode 100644 src/Banner.tsx delete mode 100644 src/livekit/LivekitFocus.ts delete mode 100644 src/room/usePageUnload.ts delete mode 100644 src/usePrevious.ts delete mode 100644 src/utils/array.ts diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 4b2361d2..5c676a7c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,3 +23,5 @@ jobs: run: "yarn run lint:eslint" - name: Type check run: "yarn run lint:types" + - name: Dead code analysis + run: "yarn run lint:knip" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f5afb7d5..870dabe1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,8 @@ jobs: run: "yarn run test:coverage" - name: Upload to codecov uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: unittests - token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true diff --git a/knip.ts b/knip.ts new file mode 100644 index 00000000..becafc2e --- /dev/null +++ b/knip.ts @@ -0,0 +1,30 @@ +import { KnipConfig } from "knip"; + +export default { + entry: ["src/main.tsx", "i18next-parser.config.ts"], + ignoreBinaries: [ + // This is deprecated, so Knip doesn't actually recognize it as a globally + // installed binary. TODO We should switch to Compose v2: + // https://docs.docker.com/compose/migrate/ + "docker-compose", + ], + ignoreDependencies: [ + // Used in CSS + "normalize.css", + // Used for its global type declarations + "@types/grecaptcha", + // Because we use matrix-js-sdk as a Git dependency rather than consuming + // the proper release artifacts, and also import directly from src/, we're + // forced to re-install some of the types that it depends on even though + // these look unused to Knip + "@types/content-type", + "@types/sdp-transform", + "@types/uuid", + // We obviously use this, but if the package has been linked with yarn link, + // then Knip will flag it as a false positive + // https://github.com/webpro-nl/knip/issues/766 + "@vector-im/compound-web", + "matrix-widget-api", + ], + ignoreExportsUsedInFile: true, +} satisfies KnipConfig; diff --git a/package.json b/package.json index 175a5655..fa2e6bb8 100644 --- a/package.json +++ b/package.json @@ -8,32 +8,39 @@ "serve": "vite preview", "prettier:check": "prettier -c .", "prettier:format": "prettier -w .", - "lint": "yarn lint:types && yarn lint:eslint", + "lint": "yarn lint:types && yarn lint:eslint && yarn lint:knip", "lint:eslint": "eslint --max-warnings 0 src", "lint:eslint-fix": "eslint --max-warnings 0 src --fix", + "lint:knip": "knip", "lint:types": "tsc", - "i18n": "node_modules/i18next-parser/bin/cli.js", - "i18n:check": "node_modules/i18next-parser/bin/cli.js --fail-on-warnings --fail-on-update", + "i18n": "i18next", + "i18n:check": "i18next --fail-on-warnings --fail-on-update", "test": "vitest", "test:coverage": "vitest --coverage", "backend": "docker-compose -f backend-docker-compose.yml up" }, - "dependencies": { + "devDependencies": { + "@babel/core": "^7.16.5", + "@babel/preset-env": "^7.22.20", + "@babel/preset-react": "^7.22.15", + "@babel/preset-typescript": "^7.23.0", "@juggle/resize-observer": "^3.3.1", "@livekit/components-core": "^0.11.0", "@livekit/components-react": "^2.0.0", "@opentelemetry/api": "^1.4.0", - "@opentelemetry/context-zone": "^1.9.1", - "@opentelemetry/exporter-jaeger": "^1.9.1", + "@opentelemetry/core": "^1.25.1", "@opentelemetry/exporter-trace-otlp-http": "^0.52.0", - "@opentelemetry/instrumentation-document-load": "^0.39.0", - "@opentelemetry/instrumentation-user-interaction": "^0.39.0", + "@opentelemetry/resources": "^1.25.1", + "@opentelemetry/sdk-trace-base": "^1.25.1", "@opentelemetry/sdk-trace-web": "^1.9.1", + "@opentelemetry/semantic-conventions": "^1.25.1", "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-visually-hidden": "^1.0.3", "@react-aria/button": "^3.3.4", "@react-aria/focus": "^3.5.0", + "@react-aria/interactions": "^3.9.1", + "@react-aria/listbox": "^3.5.1", "@react-aria/menu": "^3.3.0", "@react-aria/overlays": "^3.7.3", "@react-aria/select": "^3.6.0", @@ -42,71 +49,40 @@ "@react-aria/utils": "^3.10.0", "@react-spring/web": "^9.4.4", "@react-stately/collections": "^3.3.4", + "@react-stately/list": "^3.5.1", + "@react-stately/menu": "^3.3.1", "@react-stately/select": "^3.1.3", + "@react-stately/tabs": "^3.1.1", "@react-stately/tooltip": "^3.0.5", "@react-stately/tree": "^3.2.0", - "@sentry/react": "^8.0.0", - "@sentry/tracing": "^7.0.0", - "@types/lodash": "^4.14.199", - "@use-gesture/react": "^10.2.11", - "@vector-im/compound-design-tokens": "^1.0.0", - "@vector-im/compound-web": "^6.0.0", - "@vitejs/plugin-basic-ssl": "^1.0.1", - "@vitejs/plugin-react": "^4.0.1", - "buffer": "^6.0.3", - "classnames": "^2.3.1", - "events": "^3.3.0", - "i18next": "^23.0.0", - "i18next-browser-languagedetector": "^8.0.0", - "i18next-http-backend": "^2.0.0", - "livekit-client": "^2.0.2", - "lodash": "^4.17.21", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#467908703bc67fa3e23d978f5549e2709d4acf74", - "matrix-widget-api": "^1.8.2", - "normalize.css": "^8.0.1", - "observable-hooks": "^4.2.3", - "pako": "^2.0.4", - "postcss-preset-env": "^10.0.0", - "posthog-js": "^1.29.0", - "react": "18", - "react-dom": "18", - "react-i18next": "^15.0.0", - "react-router-dom": "^5.2.0", - "react-use-clipboard": "^1.0.7", - "react-use-measure": "^2.1.1", - "rxjs": "^7.8.1", - "sdp-transform": "^2.14.1", - "tinyqueue": "^3.0.0", - "unique-names-generator": "^4.6.0", - "uuid": "10", - "vaul": "^0.9.0" - }, - "devDependencies": { - "@babel/core": "^7.16.5", - "@babel/preset-env": "^7.22.20", - "@babel/preset-react": "^7.22.15", - "@babel/preset-typescript": "^7.23.0", - "@react-spring/rafz": "^9.7.3", "@react-types/dialog": "^3.5.5", + "@react-types/menu": "^3.6.1", + "@react-types/overlays": "^3.6.1", + "@react-types/shared": "^3.13.1", + "@react-types/tabs": "^3.1.1", + "@sentry/react": "^8.0.0", "@sentry/vite-plugin": "^2.0.0", "@testing-library/dom": "^10.1.0", "@testing-library/react": "^16.0.0", "@testing-library/user-event": "^14.5.1", "@types/content-type": "^1.1.5", - "@types/dom-screen-wake-lock": "^1.0.1", - "@types/dompurify": "^3.0.2", "@types/grecaptcha": "^3.0.9", + "@types/lodash": "^4.14.199", "@types/node": "^20.0.0", "@types/react-dom": "^18.3.0", "@types/react-router-dom": "^5.3.3", - "@types/request": "^2.48.8", "@types/sdp-transform": "^2.4.5", "@types/uuid": "10", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.0.0", + "@use-gesture/react": "^10.2.11", + "@vector-im/compound-design-tokens": "^1.0.0", + "@vector-im/compound-web": "^6.0.0", + "@vitejs/plugin-basic-ssl": "^1.0.1", + "@vitejs/plugin-react": "^4.0.1", "@vitest/coverage-v8": "^2.0.5", - "babel-loader": "^9.0.0", "babel-plugin-transform-vite-meta-env": "^1.0.3", + "classnames": "^2.3.1", "eslint": "^8.14.0", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.0.0", @@ -118,12 +94,37 @@ "eslint-plugin-react-hooks": "^4.5.0", "eslint-plugin-unicorn": "^55.0.0", "global-jsdom": "^24.0.0", + "history": "^4.0.0", + "i18next": "^23.0.0", + "i18next-browser-languagedetector": "^8.0.0", + "i18next-http-backend": "^2.0.0", "i18next-parser": "^9.0.0", "jsdom": "^25.0.0", + "knip": "^5.27.2", + "livekit-client": "^2.0.2", + "lodash": "^4.17.21", + "loglevel": "^1.9.1", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#467908703bc67fa3e23d978f5549e2709d4acf74", + "matrix-widget-api": "^1.8.2", + "normalize.css": "^8.0.1", + "observable-hooks": "^4.2.3", + "pako": "^2.0.4", + "postcss": "^8.4.41", + "postcss-preset-env": "^10.0.0", + "posthog-js": "^1.29.0", "prettier": "^3.0.0", + "react": "18", + "react-dom": "18", + "react-i18next": "^15.0.0", + "react-router-dom": "^5.2.0", + "react-use-clipboard": "^1.0.7", + "react-use-measure": "^2.1.1", + "rxjs": "^7.8.1", "sass": "^1.42.1", "typescript": "^5.1.6", "typescript-eslint-language-service": "^5.0.5", + "unique-names-generator": "^4.6.0", + "vaul": "^0.9.0", "vite": "^5.0.0", "vite-plugin-html-template": "^1.1.0", "vite-plugin-svgr": "^4.0.0", diff --git a/renovate.json b/renovate.json index 10dfca5d..009174f4 100644 --- a/renovate.json +++ b/renovate.json @@ -48,6 +48,8 @@ "ignoreDeps": [ "@react-aria/button", "@react-aria/focus", + "@react-aria/interactions", + "@react-aria/listbox", "@react-aria/menu", "@react-aria/overlays", "@react-aria/select", @@ -55,9 +57,16 @@ "@react-aria/tooltip", "@react-aria/utils", "@react-stately/collections", + "@react-stately/list", + "@react-stately/menu", "@react-stately/select", + "@react-stately/tabs", "@react-stately/tooltip", "@react-stately/tree", - "@react-types/dialog" + "@react-types/dialog", + "@react-types/menu", + "@react-types/overlays", + "@react-types/shared", + "@react-types/tabs" ] } diff --git a/src/Banner.tsx b/src/Banner.tsx deleted file mode 100644 index 87ce8a96..00000000 --- a/src/Banner.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2023 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { FC, ReactNode } from "react"; - -import styles from "./Banner.module.css"; - -interface Props { - children: ReactNode; -} - -export const Banner: FC = ({ children }) => { - return
{children}
; -}; diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index 3d798453..f3b8d229 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -40,10 +40,7 @@ import { Caption } from "../typography/Typography"; import { Form } from "../form/Form"; import { AnalyticsNotice } from "../analytics/AnalyticsNotice"; import { E2eeType } from "../e2ee/e2eeType"; -import { - useSetting, - optInAnalytics as optInAnalyticsSetting, -} from "../settings/settings"; +import { useOptInAnalytics } from "../settings/settings"; interface Props { client: MatrixClient; @@ -52,7 +49,7 @@ interface Props { export const RegisteredView: FC = ({ client }) => { const [loading, setLoading] = useState(false); const [error, setError] = useState(); - const [optInAnalytics] = useSetting(optInAnalyticsSetting); + const [optInAnalytics] = useOptInAnalytics(); const history = useHistory(); const { t } = useTranslation(); const [joinExistingCallModalOpen, setJoinExistingCallModalOpen] = diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index 8950115e..82e44991 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -43,16 +43,13 @@ import { generateRandomName } from "../auth/generateRandomName"; import { AnalyticsNotice } from "../analytics/AnalyticsNotice"; import { Config } from "../config/Config"; import { E2eeType } from "../e2ee/e2eeType"; -import { - useSetting, - optInAnalytics as optInAnalyticsSetting, -} from "../settings/settings"; +import { useOptInAnalytics } from "../settings/settings"; export const UnauthenticatedView: FC = () => { const { setClient } = useClient(); const [loading, setLoading] = useState(false); const [error, setError] = useState(); - const [optInAnalytics] = useSetting(optInAnalyticsSetting); + const [optInAnalytics] = useOptInAnalytics(); const { recaptchaKey, register } = useInteractiveRegistration(); const { execute, reset, recaptchaId } = useRecaptcha(recaptchaKey); diff --git a/src/livekit/LivekitFocus.ts b/src/livekit/LivekitFocus.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index bfcf94fd..00071331 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -35,10 +35,7 @@ import { LobbyView } from "./LobbyView"; import { E2eeType } from "../e2ee/e2eeType"; import { useProfile } from "../profile/useProfile"; import { useMuteStates } from "./MuteStates"; -import { - useSetting, - optInAnalytics as optInAnalyticsSetting, -} from "../settings/settings"; +import { useOptInAnalytics } from "../settings/settings"; export const RoomPage: FC = () => { const { @@ -83,7 +80,7 @@ export const RoomPage: FC = () => { registerPasswordlessUser, ]); - const [optInAnalytics, setOptInAnalytics] = useSetting(optInAnalyticsSetting); + const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics(); useEffect(() => { // During the beta, opt into analytics by default if (optInAnalytics === null && setOptInAnalytics) setOptInAnalytics(true); diff --git a/src/room/usePageUnload.ts b/src/room/usePageUnload.ts deleted file mode 100644 index 679ae9e9..00000000 --- a/src/room/usePageUnload.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { useEffect } from "react"; - -import { platform } from "../Platform"; - -export function usePageUnload(callback: () => void): void { - useEffect(() => { - let pageVisibilityTimeout: ReturnType; - - function onBeforeUnload(event: PageTransitionEvent): void { - if (event.type === "visibilitychange") { - if (document.visibilityState === "visible") { - clearTimeout(pageVisibilityTimeout); - } else { - // Wait 5 seconds before closing the page to avoid accidentally leaving - // TODO: Make this configurable? - pageVisibilityTimeout = setTimeout(() => { - callback(); - }, 5000); - } - } else { - callback(); - } - } - - // iOS doesn't fire beforeunload event, so leave the call when you hide the page. - if (platform === "ios") { - window.addEventListener("pagehide", onBeforeUnload); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - document.addEventListener("visibilitychange", onBeforeUnload); - } - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - window.addEventListener("beforeunload", onBeforeUnload); - - return (): void => { - window.removeEventListener("pagehide", onBeforeUnload); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - document.removeEventListener("visibilitychange", onBeforeUnload); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - window.removeEventListener("beforeunload", onBeforeUnload); - clearTimeout(pageVisibilityTimeout); - }; - }, [callback]); -} diff --git a/src/settings/SettingsModal.tsx b/src/settings/SettingsModal.tsx index 6763cc5d..20e5875d 100644 --- a/src/settings/SettingsModal.tsx +++ b/src/settings/SettingsModal.tsx @@ -42,9 +42,9 @@ import { import { widget } from "../widget"; import { useSetting, - optInAnalytics as optInAnalyticsSetting, developerSettingsTab as developerSettingsTabSetting, duplicateTiles as duplicateTilesSetting, + useOptInAnalytics, } from "./settings"; import { isFirefox } from "../Platform"; @@ -77,7 +77,7 @@ export const SettingsModal: FC = ({ }) => { const { t } = useTranslation(); - const [optInAnalytics, setOptInAnalytics] = useSetting(optInAnalyticsSetting); + const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics(); const [developerSettingsTab, setDeveloperSettingsTab] = useSetting( developerSettingsTabSetting, ); diff --git a/src/useEvents.ts b/src/useEvents.ts index 66c5084a..6e883599 100644 --- a/src/useEvents.ts +++ b/src/useEvents.ts @@ -15,7 +15,6 @@ limitations under the License. */ import { useEffect } from "react"; -import EventEmitter, { EventMap } from "typed-emitter"; import type { Listener, @@ -60,20 +59,3 @@ export function useTypedEventEmitter< }; }, [emitter, eventType, listener]); } - -// Shortcut for registering a listener on an eventemitter3 EventEmitter (ie. what the LiveKit SDK uses) -export function useEventEmitterThree< - EventType extends keyof T, - T extends EventMap, ->( - emitter: EventEmitter, - eventType: EventType, - listener: T[EventType], -): void { - useEffect(() => { - emitter.on(eventType, listener); - return (): void => { - emitter.off(eventType, listener); - }; - }, [emitter, eventType, listener]); -} diff --git a/src/useLocalStorage.ts b/src/useLocalStorage.ts index 318c691f..c2ce9e78 100644 --- a/src/useLocalStorage.ts +++ b/src/useLocalStorage.ts @@ -50,9 +50,6 @@ export const useLocalStorage = ( ]; }; -export const getLocalStorageItem = (key: string): LocalStorageItem => - localStorage.getItem(key); - export const setLocalStorageItem = (key: string, value: string): void => { localStorage.setItem(key, value); localStorageBus.emit(key, value); diff --git a/src/usePrevious.ts b/src/usePrevious.ts deleted file mode 100644 index b298c10e..00000000 --- a/src/usePrevious.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2023 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { useRef } from "react"; - -/** - * React hook that returns the value given on the previous render. - */ -export function usePrevious(value: T): T | undefined { - const ref = useRef(); - const previous = ref.current; - ref.current = value; - return previous; -} diff --git a/src/utils/array.ts b/src/utils/array.ts deleted file mode 100644 index 0bb0270d..00000000 --- a/src/utils/array.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2023 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - * Gets the index of the last element in the array to satsify the given - * predicate. - */ -// TODO: remove this once TypeScript recognizes the existence of -// Array.prototype.findLastIndex -export function findLastIndex( - array: T[], - predicate: (item: T, index: number) => boolean, -): number | null { - for (let i = array.length - 1; i >= 0; i--) { - if (predicate(array[i], i)) return i; - } - - return null; -} - -/** - * Counts the number of elements in an array that satsify the given predicate. - */ -export const count = ( - array: T[], - predicate: (item: T, index: number) => boolean, -): number => - array.reduce( - (acc, item, index) => (predicate(item, index) ? acc + 1 : acc), - 0, - ); diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index a992b5ce..6955072b 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -246,38 +246,6 @@ export function sanitiseRoomNameInput(input: string): string { return input; } -/** - * XXX: What is this trying to do? It looks like it's getting the localpart from - * a room alias, but why is it splitting on hyphens and then putting spaces in?? - * @param roomId - * @returns - */ -export function roomNameFromRoomId(roomId: string): string { - return roomId - .match(/([^:]+):.*$/)![1] - .substring(1) - .split("-") - .map((part) => - part.length > 0 ? part.charAt(0).toUpperCase() + part.slice(1) : part, - ) - .join(" ") - .toLowerCase(); -} - -export function isLocalRoomId(roomId: string, client: MatrixClient): boolean { - if (!roomId) { - return false; - } - - const parts = roomId.match(/[^:]+:(.*)$/)!; - - if (parts.length < 2) { - return false; - } - - return parts[1] === client.getDomain(); -} - interface CreateRoomResult { roomId: string; alias?: string; diff --git a/src/widget.ts b/src/widget.ts index c376791c..8ce55ace 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -31,21 +31,6 @@ export enum ElementWidgetActions { HangupCall = "im.vector.hangup", TileLayout = "io.element.tile_layout", SpotlightLayout = "io.element.spotlight_layout", - - // Element Call -> host requesting to start a screenshare - // (ie. expects a ScreenshareStart once the user has picked a source) - // Element Call -> host requesting to start a screenshare - // (ie. expects a ScreenshareStart once the user has picked a source) - // replies with { pending } where pending is true if the host has asked - // the user to choose a window and false if not (ie. if the host isn't - // running within Electron) - ScreenshareRequest = "io.element.screenshare_request", - // host -> Element Call telling EC to start screen sharing with - // the given source - ScreenshareStart = "io.element.screenshare_start", - // host -> Element Call telling EC to stop screen sharing, or that - // the user cancelled when selecting a source after a ScreenshareRequest - ScreenshareStop = "io.element.screenshare_stop", // This can be sent as from or to widget // fromWidget: updates the client about the current device mute state // toWidget: the client requests a specific device mute configuration @@ -68,10 +53,6 @@ export interface JoinCallData { videoInput: string | null; } -export interface ScreenshareStartData { - desktopCapturerSourceId: string; -} - export interface WidgetHelpers { api: WidgetApi; lazyActions: LazyEventEmitter; @@ -101,8 +82,6 @@ export const widget = ((): WidgetHelpers | null => { ElementWidgetActions.HangupCall, ElementWidgetActions.TileLayout, ElementWidgetActions.SpotlightLayout, - ElementWidgetActions.ScreenshareStart, - ElementWidgetActions.ScreenshareStop, ElementWidgetActions.DeviceMute, ].forEach((action) => { api.on(`action:${action}`, (ev: CustomEvent) => { diff --git a/vitest.config.js b/vitest.config.js index b90f74c2..43b407b7 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,5 +1,5 @@ import { defineConfig, mergeConfig } from "vitest/config"; -import viteConfig from "./vite.config"; +import viteConfig from "./vite.config.js"; export default defineConfig((configEnv) => mergeConfig( diff --git a/yarn.lock b/yarn.lock index ba73d1b0..9c97f098 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1108,7 +1108,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.24.7", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.20.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.7.tgz#6027fe12bc1aa724cd32ab113fb7f1988f1f66f2" integrity sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q== @@ -1135,7 +1135,7 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" -"@babel/types@^7.24.8", "@babel/types@^7.25.0", "@babel/types@^7.25.2": +"@babel/types@^7.24.7", "@babel/types@^7.24.8", "@babel/types@^7.25.0", "@babel/types@^7.25.2", "@babel/types@^7.4.4": version "7.25.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.2.tgz#55fb231f7dc958cd69ea141a4c2997e819646125" integrity sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q== @@ -1968,7 +1968,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": +"@nodelib/fs.walk@1.2.8", "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -1988,43 +1988,13 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== -"@opentelemetry/context-zone-peer-dep@1.25.1": - version "1.25.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-zone-peer-dep/-/context-zone-peer-dep-1.25.1.tgz#e7c6400bad864c34342d4429e64d58e416f26ac0" - integrity sha512-UxSY9K90xOg2eI7qZStx0HV6DZT6tcRX+IiAWTvROi6h9Td2c2vlQhBZ9F1JH7kINmNCZN1f1//O9rSioPEMlg== - -"@opentelemetry/context-zone@^1.9.1": - version "1.25.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-zone/-/context-zone-1.25.1.tgz#b984d5ed71f346ceb708b34835db7d16af78b583" - integrity sha512-kHbMs95mKNJPpfd1LE1/IRxUw5D1fyTOM+0R1yDOOzffs9ZZsQqgQ1Q7q0bWZ/kVLWjL43fiALe+rPtQvRShdg== - dependencies: - "@opentelemetry/context-zone-peer-dep" "1.25.1" - zone.js "^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0" - -"@opentelemetry/core@1.19.0", "@opentelemetry/core@^1.8.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.19.0.tgz#6563bb65465bf232d8435553b9a122d9351c0fbb" - integrity sha512-w42AukJh3TP8R0IZZOVJVM/kMWu8g+lm4LzT70WtuKqhwq7KVhcDzZZuZinWZa6TtQCl7Smt2wolEYzpHabOgw== - dependencies: - "@opentelemetry/semantic-conventions" "1.19.0" - -"@opentelemetry/core@1.25.1": +"@opentelemetry/core@1.25.1", "@opentelemetry/core@^1.25.1": version "1.25.1" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.25.1.tgz#ff667d939d128adfc7c793edae2f6bca177f829d" integrity sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ== dependencies: "@opentelemetry/semantic-conventions" "1.25.1" -"@opentelemetry/exporter-jaeger@^1.9.1": - version "1.25.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-jaeger/-/exporter-jaeger-1.25.1.tgz#0f4d4c233b0b5875533beaa990dec51e7bd043e3" - integrity sha512-6/HwzrwUx0fpkFXrouF0IJp+hpN8xkx8RqEk+BZfeoMAHydpyigyYsKyAtAZRwfJe45WWJbJUqoK8aBjiC9iLQ== - dependencies: - "@opentelemetry/core" "1.25.1" - "@opentelemetry/sdk-trace-base" "1.25.1" - "@opentelemetry/semantic-conventions" "1.25.1" - jaeger-client "^3.15.0" - "@opentelemetry/exporter-trace-otlp-http@^0.52.0": version "0.52.1" resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.52.1.tgz#99549e05f581050d0df2c1c684d1a819c480ebc6" @@ -2036,38 +2006,6 @@ "@opentelemetry/resources" "1.25.1" "@opentelemetry/sdk-trace-base" "1.25.1" -"@opentelemetry/instrumentation-document-load@^0.39.0": - version "0.39.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-document-load/-/instrumentation-document-load-0.39.0.tgz#d20b85b2d39fd29cc42cb7e5e12298b228556eb2" - integrity sha512-M8QTHM1fFoJvQ1EYaxAF7V5RJhG4c+o4gWHLSFQl6dvQJuGiSdhM3azenRFcTe88Sn6AmVYRGiUjlac9GSVQ2g== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.52.0" - "@opentelemetry/sdk-trace-base" "^1.0.0" - "@opentelemetry/sdk-trace-web" "^1.15.0" - "@opentelemetry/semantic-conventions" "^1.22.0" - -"@opentelemetry/instrumentation-user-interaction@^0.39.0": - version "0.39.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-user-interaction/-/instrumentation-user-interaction-0.39.0.tgz#318f273fd7d52a98d3ee36318842331513e78a69" - integrity sha512-hO/D1g8/P1fo5lEEHpxHHnxXDRfysjBZdFGwR6oSIoZWAQW1EasxZRe2mYDnxc37vEZsFFxTWXayH+XMKOo/sw== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.52.0" - "@opentelemetry/sdk-trace-web" "^1.8.0" - -"@opentelemetry/instrumentation@^0.52.0": - version "0.52.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz#2e7e46a38bd7afbf03cf688c862b0b43418b7f48" - integrity sha512-uXJbYU/5/MBHjMp1FqrILLRuiJCs3Ofk0MeRDk8g1S1gD47U8X3JnSwcMO1rtRo1x1a7zKaQHaoYu49p/4eSKw== - dependencies: - "@opentelemetry/api-logs" "0.52.1" - "@types/shimmer" "^1.0.2" - import-in-the-middle "^1.8.1" - require-in-the-middle "^7.1.1" - semver "^7.5.2" - shimmer "^1.2.1" - "@opentelemetry/otlp-exporter-base@0.52.1": version "0.52.1" resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.52.1.tgz#657d9b27c55bd42ab6a8bb181006b57f9c84b91d" @@ -2089,15 +2027,7 @@ "@opentelemetry/sdk-trace-base" "1.25.1" protobufjs "^7.3.0" -"@opentelemetry/resources@1.19.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.19.0.tgz#2df9e0e8623cd390569243e2c9c15d7cce063c2f" - integrity sha512-RgxvKuuMOf7nctOeOvpDjt2BpZvZGr9Y0vf7eGtY5XYZPkh2p7e2qub1S2IArdBMf9kEbz0SfycqCviOu9isqg== - dependencies: - "@opentelemetry/core" "1.19.0" - "@opentelemetry/semantic-conventions" "1.19.0" - -"@opentelemetry/resources@1.25.1": +"@opentelemetry/resources@1.25.1", "@opentelemetry/resources@^1.25.1": version "1.25.1" resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.25.1.tgz#bb9a674af25a1a6c30840b755bc69da2796fefbb" integrity sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ== @@ -2123,7 +2053,7 @@ "@opentelemetry/resources" "1.25.1" lodash.merge "^4.6.2" -"@opentelemetry/sdk-trace-base@1.25.1": +"@opentelemetry/sdk-trace-base@1.25.1", "@opentelemetry/sdk-trace-base@^1.25.1": version "1.25.1" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz#cbc1e60af255655d2020aa14cde17b37bd13df37" integrity sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw== @@ -2132,16 +2062,7 @@ "@opentelemetry/resources" "1.25.1" "@opentelemetry/semantic-conventions" "1.25.1" -"@opentelemetry/sdk-trace-base@^1.0.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.19.0.tgz#87e629e7080945d955d53c2c12352915f5797cd3" - integrity sha512-+IRvUm+huJn2KqfFW3yW/cjvRwJ8Q7FzYHoUNx5Fr0Lws0LxjMJG1uVB8HDpLwm7mg5XXH2M5MF+0jj5cM8BpQ== - dependencies: - "@opentelemetry/core" "1.19.0" - "@opentelemetry/resources" "1.19.0" - "@opentelemetry/semantic-conventions" "1.19.0" - -"@opentelemetry/sdk-trace-web@^1.15.0", "@opentelemetry/sdk-trace-web@^1.8.0", "@opentelemetry/sdk-trace-web@^1.9.1": +"@opentelemetry/sdk-trace-web@^1.9.1": version "1.25.1" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-web/-/sdk-trace-web-1.25.1.tgz#65b48c0b68636e6905b02969d04b860e234a4391" integrity sha512-SS6JaSkHngcBCNdWGthzcvaKGRnDw2AeP57HyTEileLToJ7WLMeV+064iRlVyoT4+e77MRp2T2dDSrmaUyxoNg== @@ -2150,20 +2071,15 @@ "@opentelemetry/sdk-trace-base" "1.25.1" "@opentelemetry/semantic-conventions" "1.25.1" -"@opentelemetry/semantic-conventions@1.19.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.19.0.tgz#0c17f80b45de1c8778dfdf17acb1e9d4c4aa4ba8" - integrity sha512-14jRpC8f5c0gPSwoZ7SbEJni1PqI+AhAE8m1bMz6v+RPM4OlP1PT2UHBJj5Qh/ALLPjhVU/aZUK3YyjTUqqQVg== - "@opentelemetry/semantic-conventions@1.25.1": version "1.25.1" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz#0deecb386197c5e9c2c28f2f89f51fb8ae9f145e" integrity sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ== -"@opentelemetry/semantic-conventions@^1.22.0": - version "1.24.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.0.tgz#f074db930a7feb4d64103a9a576c5fbad046fcac" - integrity sha512-yL0jI6Ltuz8R+Opj7jClGrul6pOoYrdfVmzQS4SITXRPH7I5IRZbrwe/6/v8v4WYMa6MYZG480S1+uc/IGfqsA== +"@opentelemetry/semantic-conventions@^1.25.1": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.26.0.tgz#42da14476529ca86d0af4c11f58910f242a0a232" + integrity sha512-U9PJlOswJPSgQVPI+XEuNLElyFWkb0hAiMg+DExD9V0St03X2lPHGMdxMY/LrVmoukuIpXJ12oyrOtEZ4uXFkw== "@pkgjs/parseargs@^0.11.0": version "0.11.0" @@ -2746,7 +2662,7 @@ "@react-spring/shared" "~9.7.4" "@react-spring/types" "~9.7.4" -"@react-spring/rafz@^9.7.3", "@react-spring/rafz@~9.7.4": +"@react-spring/rafz@~9.7.4": version "9.7.4" resolved "https://registry.yarnpkg.com/@react-spring/rafz/-/rafz-9.7.4.tgz#d53aa45a8cb116b81b27ba29e0cc15470ccfd449" integrity sha512-mqDI6rW0Ca8IdryOMiXRhMtVGiEGLIO89vIOyFQXRIwwIMX30HLya24g9z4olDvFyeDW3+kibiKwtZnA4xhldA== @@ -3107,15 +3023,6 @@ "@sentry/types" "8.26.0" "@sentry/utils" "8.26.0" -"@sentry-internal/tracing@7.114.0": - version "7.114.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.114.0.tgz#bdcd364f511e2de45db6e3004faf5685ca2e0f86" - integrity sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg== - dependencies: - "@sentry/core" "7.114.0" - "@sentry/types" "7.114.0" - "@sentry/utils" "7.114.0" - "@sentry/babel-plugin-component-annotate@2.22.2": version "2.22.2" resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.2.tgz#f4a1ddea4bcac06584a6cec9a43ec088cbb6caaf" @@ -3202,14 +3109,6 @@ "@sentry/cli-win32-i686" "2.33.1" "@sentry/cli-win32-x64" "2.33.1" -"@sentry/core@7.114.0": - version "7.114.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.114.0.tgz#3efe86b92a5379c44dfd0fd4685266b1a30fa898" - integrity sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA== - dependencies: - "@sentry/types" "7.114.0" - "@sentry/utils" "7.114.0" - "@sentry/core@8.26.0": version "8.26.0" resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.26.0.tgz#0673a9e2c5b699cf1bde1ed073a345cc393577da" @@ -3229,30 +3128,11 @@ "@sentry/utils" "8.26.0" hoist-non-react-statics "^3.3.2" -"@sentry/tracing@^7.0.0": - version "7.114.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.114.0.tgz#32a3438b0f2d02fb7b7359fe7712c5a349a2a329" - integrity sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg== - dependencies: - "@sentry-internal/tracing" "7.114.0" - -"@sentry/types@7.114.0": - version "7.114.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.114.0.tgz#ab8009d5f6df23b7342121083bed34ee2452e856" - integrity sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w== - "@sentry/types@8.26.0": version "8.26.0" resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.26.0.tgz#c999fdd9e52587570f723d2370244bad8f79b571" integrity sha512-zKmh6SWsJh630rpt7a9vP4Cm4m1C2gDTUqUiH565CajCL/4cePpNWYrNwalSqsOSL7B9OrczA1+n6a6XvND+ng== -"@sentry/utils@7.114.0": - version "7.114.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.114.0.tgz#59d30a79f4acff3c9268de0b345f0bcbc6335112" - integrity sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg== - dependencies: - "@sentry/types" "7.114.0" - "@sentry/utils@8.26.0": version "8.26.0" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.26.0.tgz#c6629f0f2bc8cbc4fddd124770e9063b4e2d1c65" @@ -3268,6 +3148,15 @@ "@sentry/bundler-plugin-core" "2.22.2" unplugin "1.0.1" +"@snyk/github-codeowners@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz#45b99732c3c38b5f5b47e43d2b0c9db67a6d2bcc" + integrity sha512-lGFf08pbkEac0NYgVf4hdANpAgApRjNByLXB+WBip3qj1iendOIyAwP2GKkKbQMNVy2r1xxDf0ssfWscoiC+Vw== + dependencies: + commander "^4.1.1" + ignore "^5.1.8" + p-map "^4.0.0" + "@svgr/babel-plugin-add-jsx-attribute@8.0.0": version "8.0.0" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz#4001f5d5dd87fa13303e36ee106e3ff3a7eb8b22" @@ -3422,28 +3311,11 @@ dependencies: "@babel/types" "^7.20.7" -"@types/caseless@*": - version "0.12.5" - resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.5.tgz#db9468cb1b1b5a925b8f34822f1669df0c5472f5" - integrity sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg== - "@types/content-type@^1.1.5": version "1.1.8" resolved "https://registry.yarnpkg.com/@types/content-type/-/content-type-1.1.8.tgz#319644d07ee6b4bfc734483008393b89b99f0219" integrity sha512-1tBhmVUeso3+ahfyaKluXe38p+94lovUZdoVfQ3OnJo9uJC42JT7CBoN3k9HYhAae+GwiBYmHu+N9FZhOG+2Pg== -"@types/dom-screen-wake-lock@^1.0.1": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/dom-screen-wake-lock/-/dom-screen-wake-lock-1.0.3.tgz#c3588a5f6f40fae957f9ce5be9bc4927a61bb9a0" - integrity sha512-3Iten7X3Zgwvk6kh6/NRdwN7WbZ760YgFCsF5AxDifltUQzW1RaW+WRmcVtgwFzLjaNu64H+0MPJ13yRa8g3Dw== - -"@types/dompurify@^3.0.2": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-3.0.5.tgz#02069a2fcb89a163bacf1a788f73cb415dd75cb7" - integrity sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg== - dependencies: - "@types/trusted-types" "*" - "@types/estree@1.0.5", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -3464,11 +3336,6 @@ resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA== -"@types/json-schema@^7.0.9": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -3484,7 +3351,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@>=13.7.0": +"@types/node@>=13.7.0": version "22.1.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.1.0.tgz#6d6adc648b5e03f0e83c78dc788c2b037d0ad94b" integrity sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw== @@ -3540,16 +3407,6 @@ "@types/prop-types" "*" csstype "^3.0.2" -"@types/request@^2.48.8": - version "2.48.12" - resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.12.tgz#0f590f615a10f87da18e9790ac94c29ec4c5ef30" - integrity sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw== - dependencies: - "@types/caseless" "*" - "@types/node" "*" - "@types/tough-cookie" "*" - form-data "^2.5.0" - "@types/retry@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" @@ -3560,26 +3417,11 @@ resolved "https://registry.yarnpkg.com/@types/sdp-transform/-/sdp-transform-2.4.9.tgz#26ef39f487a6909b0512f580b80920a366b27f52" integrity sha512-bVr+/OoZZy7wrHlNcEAAa6PAgKA4BoXPYVN2EijMC5WnGgQ4ZEuixmKnVs2roiAvr7RhIFVH17QD27cojgIZCg== -"@types/shimmer@^1.0.2": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.0.5.tgz#491d8984d4510e550bfeb02d518791d7f59d2b88" - integrity sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww== - "@types/symlink-or-copy@^1.2.0": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/symlink-or-copy/-/symlink-or-copy-1.2.2.tgz#51b1c00b516a5774ada5d611e65eb123f988ef8d" integrity sha512-MQ1AnmTLOncwEf9IVU+B2e4Hchrku5N67NkgcAHW0p3sdzPe0FNMANxEm6OJUzPniEQGkeT3OROLlCwZJLWFZA== -"@types/tough-cookie@*": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" - integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== - -"@types/trusted-types@*": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.6.tgz#d12451beaeb9c3838f12024580dc500b7e88b0ad" - integrity sha512-HYtNooPvUY9WAVRBr4u+4Qa9fYD1ze2IUlAD3HoA6oehn1taGwBx3Oa52U4mTslTS+GAExKpaFu39Y5xUEwfjg== - "@types/uuid@10": version "10.0.0" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" @@ -3789,11 +3631,6 @@ loupe "^3.1.1" tinyrainbow "^1.2.0" -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -3804,7 +3641,7 @@ acorn@^8.8.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== -acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -3823,19 +3660,13 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" -ajv-formats@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" - integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: - ajv "^8.0.0" - -ajv-keywords@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" - integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== - dependencies: - fast-deep-equal "^3.1.3" + clean-stack "^2.0.0" + indent-string "^4.0.0" ajv@^6.12.4: version "6.12.6" @@ -3847,26 +3678,11 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.9.0: - version "8.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" - integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - another-json@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/another-json/-/another-json-0.2.0.tgz#b5f4019c973b6dd5c6506a2d93469cb6d32aeedc" integrity sha512-/Ndrl68UQLhnCdsAzEXLMFuOR546o2qbYRqCglaNHbjXrwG1ayTcdwr3zkSGOGtGXDyR5X9nCFfnyG2AFJIsqg== -ansi-color@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-color/-/ansi-color-0.2.1.tgz#3e75c037475217544ed763a8db5709fa9ae5bf9a" - integrity sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -4090,14 +3906,6 @@ b4a@^1.6.4: resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.6.tgz#a4cc349a3851987c3c4ac2d7785c18744f6da9ba" integrity sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg== -babel-loader@^9.0.0: - version "9.1.3" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.3.tgz#3d0e01b4e69760cc694ee306fe16d358aa1c6f9a" - integrity sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw== - dependencies: - find-cache-dir "^4.0.0" - schema-utils "^4.0.0" - babel-plugin-polyfill-corejs2@^0.4.10: version "0.4.11" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" @@ -4248,16 +4056,6 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -bufrw@^1.2.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/bufrw/-/bufrw-1.4.0.tgz#58a294ca0bd9ebc880be83001d749706fc996499" - integrity sha512-sWm8iPbqvL9+5SiYxXH73UOkyEbGQg7kyHQmReF89WJHQJw2eV4P/yZ0E+b71cczJ4pPobVhXxgQcmfSTgGHxQ== - dependencies: - ansi-color "^0.2.1" - error "^7.0.0" - hexer "^1.5.0" - xtend "^4.0.0" - builtin-modules@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" @@ -4376,11 +4174,6 @@ ci-info@^4.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.0.0.tgz#65466f8b280fc019b9f50a5388115d17a63a44f2" integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg== -cjs-module-lexer@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" - integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== - classnames@^2.3.1, classnames@^2.3.2: version "2.5.1" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.5.1.tgz#ba774c614be0f016da105c858e7159eae8e7687b" @@ -4393,11 +4186,21 @@ clean-regexp@^1.0.0: dependencies: escape-string-regexp "^1.0.5" +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + clone-stats@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" integrity sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag== +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + clone@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" @@ -4442,23 +4245,23 @@ colors@1.4.0: resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -combined-stream@^1.0.6, combined-stream@^1.0.8: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" +commander@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + commander@~12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== -common-path-prefix@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" - integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -4697,6 +4500,13 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" @@ -4812,6 +4622,15 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +easy-table@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/easy-table/-/easy-table-1.2.0.tgz#ba9225d7138fee307bfd4f0b5bc3c04bdc7c54eb" + integrity sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww== + dependencies: + ansi-regex "^5.0.1" + optionalDependencies: + wcwidth "^1.0.1" + electron-to-chromium@^1.5.4: version "1.5.13" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6" @@ -4835,6 +4654,14 @@ encoding-sniffer@^0.2.0: iconv-lite "^0.6.3" whatwg-encoding "^3.1.1" +enhanced-resolve@^5.17.1: + version "5.17.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" + integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + ensure-posix-path@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ensure-posix-path/-/ensure-posix-path-1.1.1.tgz#3c62bdb19fa4681544289edb2b382adc029179ce" @@ -4857,21 +4684,6 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -error@7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/error/-/error-7.0.2.tgz#a5f75fff4d9926126ddac0ea5dc38e689153cb02" - integrity sha512-UtVv4l5MhijsYUxPJo4390gzfZvAnTHreNnDjnTZaKIiZ/SemXxAhBkYSKtWa5RtBXbLP8tMgn/n0RUa/H7jXw== - dependencies: - string-template "~0.2.1" - xtend "~4.0.0" - -error@^7.0.0: - version "7.2.1" - resolved "https://registry.yarnpkg.com/error/-/error-7.2.1.tgz#eab21a4689b5f684fc83da84a0e390de82d94894" - integrity sha512-fo9HBvWnx3NGUKMvMwB/CBCMMrfEJgbDTVDEkPygA3Bdd3lM1OyCd+rbQ8BwnpF6GdVeOLDNmyL4N5Bg80ZvdA== - dependencies: - string-template "~0.2.1" - es-abstract@^1.17.5, es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.1, es-abstract@^1.23.2, es-abstract@^1.23.3: version "1.23.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" @@ -5341,7 +5153,7 @@ fast-fifo@^1.3.2: resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.2.9: +fast-glob@^3.2.9, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -5388,14 +5200,6 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -find-cache-dir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2" - integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg== - dependencies: - common-path-prefix "^3.0.0" - pkg-dir "^7.0.0" - find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -5412,14 +5216,6 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -find-up@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" - integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== - dependencies: - locate-path "^7.1.0" - path-exists "^5.0.0" - flat-cache@^3.0.4: version "3.2.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" @@ -5449,15 +5245,6 @@ foreground-child@^3.1.0: cross-spawn "^7.0.0" signal-exit "^4.0.1" -form-data@^2.5.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" - integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -5701,7 +5488,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.8: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.8: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -5779,17 +5566,7 @@ heimdalljs@^0.2.6: dependencies: rsvp "~3.2.1" -hexer@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/hexer/-/hexer-1.5.0.tgz#b86ce808598e8a9d1892c571f3cedd86fc9f0653" - integrity sha512-dyrPC8KzBzUJ19QTIo1gXNqIISRXQ0NwteW6OeQHRN4ZuZeHkdODfj0zHBdOlHbRY8GqbqK57C9oWSvQZizFsg== - dependencies: - ansi-color "^0.2.1" - minimist "^1.1.0" - process "^0.10.0" - xtend "^4.0.0" - -history@^4.9.0: +history@^4.0.0, history@^4.9.0: version "4.10.1" resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew== @@ -5927,6 +5704,11 @@ ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== +ignore@^5.1.8: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + ignore@^5.2.0, ignore@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" @@ -5945,16 +5727,6 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-in-the-middle@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.8.1.tgz#8b51c2cc631b64e53e958d7048d2d9463ce628f8" - integrity sha512-yhRwoHtiLGvmSozNOALgjRPFI6uYsds60EoMqqnXyyv+JOIW/BrrLejuTGBt+bq0T5tLzOHrN0T7xYTm4Qt/ng== - dependencies: - acorn "^8.8.2" - acorn-import-attributes "^1.9.5" - cjs-module-lexer "^1.2.2" - module-details-from-path "^1.0.3" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -6314,16 +6086,10 @@ jackspeak@^3.1.2: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -jaeger-client@^3.15.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/jaeger-client/-/jaeger-client-3.19.0.tgz#9b5bd818ebd24e818616ee0f5cffe1722a53ae6e" - integrity sha512-M0c7cKHmdyEUtjemnJyx/y9uX16XHocL46yQvyqDlPdvAcwPDbHrIbKjQdBqtiE4apQ/9dmr+ZLJYYPGnurgpw== - dependencies: - node-int64 "^0.4.0" - opentracing "^0.14.4" - thriftrw "^3.5.0" - uuid "^8.3.2" - xorshift "^1.1.1" +jiti@^1.21.6: + version "1.21.6" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.6.tgz#6c7f7398dd4b3142767f9a168af2f317a428d268" + integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -6394,11 +6160,6 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -6454,6 +6215,28 @@ keyv@^4.5.3: dependencies: json-buffer "3.0.1" +knip@^5.27.2: + version "5.27.2" + resolved "https://registry.yarnpkg.com/knip/-/knip-5.27.2.tgz#8a5a569a5baac0ab2e06dbd5454f07608ccb1952" + integrity sha512-Mya1XEDq1oygibQf0uocQd02Fil8RtvNVhcFAcxypjcc6zakT7wsJtS0xvuwEitilfI0tiFC9PghmJQ3DMKuTg== + dependencies: + "@nodelib/fs.walk" "1.2.8" + "@snyk/github-codeowners" "1.1.0" + easy-table "1.2.0" + enhanced-resolve "^5.17.1" + fast-glob "^3.3.2" + jiti "^1.21.6" + js-yaml "^4.1.0" + minimist "^1.2.8" + picocolors "^1.0.0" + picomatch "^4.0.1" + pretty-ms "^9.0.0" + smol-toml "^1.1.4" + strip-json-comments "5.0.1" + summary "2.1.0" + zod "^3.22.4" + zod-validation-error "^3.0.3" + language-subtag-registry@^0.3.20: version "0.3.23" resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz#23529e04d9e3b74679d70142df3fd2eb6ec572e7" @@ -6517,13 +6300,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -locate-path@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" - integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== - dependencies: - p-locate "^6.0.0" - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -6539,7 +6315,7 @@ lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -loglevel@1.9.1, loglevel@^1.8.0: +loglevel@1.9.1, loglevel@^1.8.0, loglevel@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.1.tgz#d63976ac9bcd03c7c873116d41c2a85bafff1be7" integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg== @@ -6549,11 +6325,6 @@ loglevel@^1.7.1: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.1.tgz#5c621f83d5b48c54ae93b6156353f555963377b4" integrity sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg== -long@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" - integrity sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ== - long@^5.0.0: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" @@ -6592,13 +6363,6 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - lz-string@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" @@ -6736,7 +6500,7 @@ minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -6756,11 +6520,6 @@ mktemp@~0.4.0: resolved "https://registry.yarnpkg.com/mktemp/-/mktemp-0.4.0.tgz#6d0515611c8a8c84e484aa2000129b98e981ff0b" integrity sha512-IXnMcJ6ZyTuhRmJSjzvHSRhlVPiN9Jwc6e59V0bEJ0ba6OBeX2L0E+mRN1QseeOF4mM+F1Rit6Nh7o+rl2Yn/A== -module-details-from-path@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" - integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A== - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -6801,11 +6560,6 @@ node-fetch@^2.6.12, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - node-releases@^2.0.18: version "2.0.18" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" @@ -6977,11 +6731,6 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" -opentracing@^0.14.4: - version "0.14.7" - resolved "https://registry.yarnpkg.com/opentracing/-/opentracing-0.14.7.tgz#25d472bd0296dc0b64d7b94cbc995219031428f5" - integrity sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q== - optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -7008,13 +6757,6 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" -p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -7029,12 +6771,12 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -p-locate@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" - integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== dependencies: - p-limit "^4.0.0" + aggregate-error "^3.0.0" p-retry@4: version "4.6.2" @@ -7076,6 +6818,11 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-ms@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-4.0.0.tgz#c0c058edd47c2a590151a718990533fd62803df4" + integrity sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw== + parse5-htmlparser2-tree-adapter@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" @@ -7103,11 +6850,6 @@ path-exists@^4.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -path-exists@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" - integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -7173,12 +6915,10 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pkg-dir@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11" - integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA== - dependencies: - find-up "^6.3.0" +picomatch@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== pluralize@^8.0.0: version "8.0.0" @@ -7502,16 +7242,18 @@ pretty-format@^27.0.2: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-ms@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-9.1.0.tgz#0ad44de6086454f48a168e5abb3c26f8db1b3253" + integrity sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw== + dependencies: + parse-ms "^4.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/process/-/process-0.10.1.tgz#842457cc51cfed72dc775afeeafb8c6034372725" - integrity sha512-dyIett8dgGIZ/TXKUzeYExt7WA6ldDzys9vTDU/cCA9L17Ypme+KzS+NjQCjpn9xsvi/shbMC+yP/BcFMBz0NA== - progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -7854,20 +7596,6 @@ replace-ext@^2.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-2.0.0.tgz#9471c213d22e1bcc26717cd6e50881d88f812b06" integrity sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug== -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -require-in-the-middle@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz#b539de8f00955444dc8aed95e17c69b0a4f10fcf" - integrity sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw== - dependencies: - debug "^4.1.1" - module-details-from-path "^1.0.3" - resolve "^1.22.1" - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -7890,7 +7618,7 @@ resolve-pathname@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng== -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -8048,16 +7776,6 @@ scheduler@^0.23.2: dependencies: loose-envify "^1.1.0" -schema-utils@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" - integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== - dependencies: - "@types/json-schema" "^7.0.9" - ajv "^8.9.0" - ajv-formats "^2.1.1" - ajv-keywords "^5.1.0" - sdp-transform@^2.14.1: version "2.14.2" resolved "https://registry.yarnpkg.com/sdp-transform/-/sdp-transform-2.14.2.tgz#d2cee6a1f7abe44e6332ac6cbb94e8600f32d813" @@ -8078,13 +7796,6 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.2: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - semver@^7.5.3: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" @@ -8138,11 +7849,6 @@ shelljs@0.8.4: interpret "^1.0.0" rechoir "^0.6.2" -shimmer@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" - integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== - side-channel@^1.0.4, side-channel@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" @@ -8168,6 +7874,11 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +smol-toml@^1.1.4: + version "1.3.0" + resolved "https://registry.yarnpkg.com/smol-toml/-/smol-toml-1.3.0.tgz#5200e251fffadbb72570c84e9776d2a3eca48143" + integrity sha512-tWpi2TsODPScmi48b/OQZGi2lgUmBCHy6SZrhi/FdnnHiU1GwebbCfuQuxsC3nHaLwtYeJGPrDZDIeodDOc4pA== + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -8254,11 +7965,6 @@ streamx@^2.12.0, streamx@^2.12.5, streamx@^2.13.2, streamx@^2.14.0: optionalDependencies: bare-events "^2.2.0" -string-template@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" - integrity sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw== - "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -8400,11 +8106,21 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" +strip-json-comments@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-5.0.1.tgz#0d8b7d01b23848ed7dbdf4baaaa31a8250d8cfa0" + integrity sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw== + strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +summary@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/summary/-/summary-2.1.0.tgz#be8a49a0aa34eb6ceea56042cae88f8add4b0885" + integrity sha512-nMIjMrd5Z2nuB2RZCKJfFMjgS3fygbeyGk9PxPPaJR1RIcyN9yn4A63Isovzm3ZtQuEkLBVgMdPup8UeLH7aQw== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -8444,6 +8160,11 @@ tabbable@^6.0.0: resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.2.0.tgz#732fb62bc0175cfcec257330be187dcfba1f3b97" integrity sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew== +tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + teex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/teex/-/teex-1.0.1.tgz#b8fa7245ef8e8effa8078281946c85ab780a0b12" @@ -8472,15 +8193,6 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -thriftrw@^3.5.0: - version "3.11.4" - resolved "https://registry.yarnpkg.com/thriftrw/-/thriftrw-3.11.4.tgz#84c990ee89e926631c0b475909ada44ee9249870" - integrity sha512-UcuBd3eanB3T10nXWRRMwfwoaC6VMk7qe3/5YIWP2Jtw+EbHqJ0p1/K3x8ixiR5dozKSSfcg1W+0e33G1Di3XA== - dependencies: - bufrw "^1.2.1" - error "7.0.2" - long "^2.4.0" - through2@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -8509,11 +8221,6 @@ tinypool@^1.0.0: resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.1.tgz#c64233c4fac4304e109a64340178760116dbe1fe" integrity sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA== -tinyqueue@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-3.0.0.tgz#101ea761ccc81f979e29200929e78f1556e3661e" - integrity sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g== - tinyrainbow@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" @@ -8834,11 +8541,6 @@ uuid@10: resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9000,6 +8702,13 @@ walk-sync@^2.2.0: matcher-collection "^2.0.0" minimatch "^3.0.4" +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + web-vitals@^4.0.1: version "4.2.3" resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.3.tgz#270c4baecfbc6ec6fc15da1989e465e5f9b94fb7" @@ -9163,12 +8872,7 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xorshift@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/xorshift/-/xorshift-1.2.0.tgz#30a4cdd8e9f8d09d959ed2a88c42a09c660e8148" - integrity sha512-iYgNnGyeeJ4t6U11NpA/QiKy+PXn5Aa3Azg5qkwIFz1tBLllQrjjsk9yzD7IAK0naNU4JxdeDgqW9ov4u/hc4g== - -xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: +xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== @@ -9178,22 +8882,17 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== +zod-validation-error@^3.0.3: + version "3.3.1" + resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-3.3.1.tgz#86adc781129d1a7fed3c3e567e8dbe7c4a15eaa4" + integrity sha512-uFzCZz7FQis256dqw4AhPQgD6f3pzNca/Zh62RNELavlumQB3nDIUFbF5JQfFLcMbO1s02Q7Xg/gpcOBlEnYZA== -"zone.js@^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0": - version "0.14.7" - resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.14.7.tgz#4a9a70599109663b1921165663bbac521995eef3" - integrity sha512-0w6DGkX2BPuiK/NLf+4A8FLE43QwBfuqz2dVgi/40Rj1WmqUskCqj329O/pwrqFJLG5X8wkeG2RhIAro441xtg== +zod@^3.22.4: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== From 0db51d9dfdf9c8921c8764571f60131a44f6465c Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 28 Aug 2024 08:44:39 -0400 Subject: [PATCH 03/13] Replace remaining React ARIA components with Compound components (#2576) * Fix issues detected by Knip Including cleaning up some unused code and dependencies, using a React hook that we unintentionally stopped using, and also adding some previously undeclared dependencies. * Replace remaining React ARIA components with Compound components * fix button position * disable scrollbars to resolve overlapping button --------- Co-authored-by: Timo --- package.json | 22 -- public/locales/en-GB/app.json | 7 +- renovate.json | 26 +- src/App.tsx | 33 +- src/Banner.module.css | 22 -- src/FullScreenView.tsx | 24 +- src/ListBox.module.css | 49 --- src/ListBox.tsx | 116 ------ src/Menu.module.css | 73 ---- src/Menu.tsx | 102 ----- src/Modal.module.css | 4 + src/Modal.tsx | 12 +- src/Tooltip.module.css | 30 -- src/Tooltip.tsx | 118 ------ src/UserMenu.module.css | 8 + src/UserMenu.tsx | 57 ++- src/auth/LoginPage.tsx | 2 +- src/auth/RegisterPage.tsx | 2 +- src/auth/useRecaptcha.ts | 3 +- src/button/Button.module.css | 238 +----------- src/button/Button.tsx | 207 +++------- src/button/CopyButton.tsx | 69 ---- src/button/Link.tsx | 61 +++ src/button/LinkButton.tsx | 59 +-- src/button/index.ts | 1 - src/home/CallList.module.css | 15 +- src/home/CallList.tsx | 11 +- src/home/JoinExistingCallModal.tsx | 11 +- src/home/RegisteredView.tsx | 2 +- src/home/UnauthenticatedView.tsx | 3 +- src/icons/ArrowDown.svg | 10 - src/icons/Audio.svg | 5 - src/icons/Copy.svg | 3 - src/icons/Developer.svg | 3 - src/icons/Edit.svg | 4 - src/icons/Feedback.svg | 3 - src/icons/Overflow.svg | 5 - src/icons/Video.svg | 4 - src/index.css | 149 +++---- src/input/AvatarInputField.module.css | 53 +-- src/input/AvatarInputField.tsx | 186 +++++---- src/input/SelectInput.module.css | 60 --- src/input/SelectInput.tsx | 80 ---- src/popover/Popover.module.css | 24 -- src/popover/Popover.tsx | 62 --- src/popover/PopoverMenu.module.css | 20 - src/popover/PopoverMenu.tsx | 98 ----- src/room/CallEndedView.module.css | 3 +- src/room/CallEndedView.tsx | 25 +- src/room/InCallView.tsx | 20 +- src/room/LayoutToggle.module.css | 7 +- src/room/LobbyView.tsx | 15 +- src/room/RageshakeRequestModal.tsx | 4 +- src/room/RoomAuthView.tsx | 2 +- src/settings/FeedbackSettingsTab.tsx | 5 +- src/settings/RageshakeButton.tsx | 6 +- src/settings/SettingsModal.tsx | 321 +++++++--------- src/tabs/Tabs.module.css | 62 +-- src/tabs/Tabs.tsx | 103 ++--- src/tile/MediaView.module.css | 4 +- src/tile/SpotlightTile.module.css | 5 +- yarn.lock | 533 +------------------------- 62 files changed, 668 insertions(+), 2603 deletions(-) delete mode 100644 src/Banner.module.css delete mode 100644 src/ListBox.module.css delete mode 100644 src/ListBox.tsx delete mode 100644 src/Menu.module.css delete mode 100644 src/Menu.tsx delete mode 100644 src/Tooltip.module.css delete mode 100644 src/Tooltip.tsx delete mode 100644 src/button/CopyButton.tsx create mode 100644 src/button/Link.tsx delete mode 100644 src/icons/ArrowDown.svg delete mode 100644 src/icons/Audio.svg delete mode 100644 src/icons/Copy.svg delete mode 100644 src/icons/Developer.svg delete mode 100644 src/icons/Edit.svg delete mode 100644 src/icons/Feedback.svg delete mode 100644 src/icons/Overflow.svg delete mode 100644 src/icons/Video.svg delete mode 100644 src/input/SelectInput.module.css delete mode 100644 src/input/SelectInput.tsx delete mode 100644 src/popover/Popover.module.css delete mode 100644 src/popover/Popover.tsx delete mode 100644 src/popover/PopoverMenu.module.css delete mode 100644 src/popover/PopoverMenu.tsx diff --git a/package.json b/package.json index fa2e6bb8..c8a2fc75 100644 --- a/package.json +++ b/package.json @@ -37,29 +37,7 @@ "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-visually-hidden": "^1.0.3", - "@react-aria/button": "^3.3.4", - "@react-aria/focus": "^3.5.0", - "@react-aria/interactions": "^3.9.1", - "@react-aria/listbox": "^3.5.1", - "@react-aria/menu": "^3.3.0", - "@react-aria/overlays": "^3.7.3", - "@react-aria/select": "^3.6.0", - "@react-aria/tabs": "^3.1.0", - "@react-aria/tooltip": "^3.1.3", - "@react-aria/utils": "^3.10.0", "@react-spring/web": "^9.4.4", - "@react-stately/collections": "^3.3.4", - "@react-stately/list": "^3.5.1", - "@react-stately/menu": "^3.3.1", - "@react-stately/select": "^3.1.3", - "@react-stately/tabs": "^3.1.1", - "@react-stately/tooltip": "^3.0.5", - "@react-stately/tree": "^3.2.0", - "@react-types/dialog": "^3.5.5", - "@react-types/menu": "^3.6.1", - "@react-types/overlays": "^3.6.1", - "@react-types/shared": "^3.13.1", - "@react-types/tabs": "^3.1.1", "@sentry/react": "^8.0.0", "@sentry/vite-plugin": "^2.0.0", "@testing-library/dom": "^10.1.0", diff --git a/public/locales/en-GB/app.json b/public/locales/en-GB/app.json index acecfc4f..0dd66420 100644 --- a/public/locales/en-GB/app.json +++ b/public/locales/en-GB/app.json @@ -4,8 +4,8 @@ }, "action": { "close": "Close", - "copy": "Copy", "copy_link": "Copy link", + "edit": "Edit", "go": "Go", "invite": "Invite", "no": "No", @@ -13,7 +13,8 @@ "remove": "Remove", "sign_in": "Sign in", "sign_out": "Sign out", - "submit": "Submit" + "submit": "Submit", + "upload_file": "Upload file" }, "analytics_notice": "By participating in this beta, you consent to the collection of anonymous data, which we use to improve the product. You can find more information about which data we track in our <2>Privacy Policy and our <5>Cookie Policy.", "app_selection_modal": { @@ -43,7 +44,6 @@ "avatar": "Avatar", "back": "Back", "camera": "Camera", - "copied": "Copied!", "display_name": "Display name", "encrypted": "Encrypted", "error": "Error", @@ -130,7 +130,6 @@ "room_auth_view_eula_caption": "By clicking \"Join call now\", you agree to our <2>End User Licensing Agreement (EULA)", "room_auth_view_join_button": "Join call now", "screenshare_button_label": "Share screen", - "select_input_unset_button": "Select an option", "settings": { "developer_settings_label": "Developer Settings", "developer_settings_label_description": "Expose developer settings in the settings window.", diff --git a/renovate.json b/renovate.json index 009174f4..91fc985a 100644 --- a/renovate.json +++ b/renovate.json @@ -44,29 +44,5 @@ "prHeader": "Please review modals on mobile for visual regressions." } ], - "semanticCommits": "disabled", - "ignoreDeps": [ - "@react-aria/button", - "@react-aria/focus", - "@react-aria/interactions", - "@react-aria/listbox", - "@react-aria/menu", - "@react-aria/overlays", - "@react-aria/select", - "@react-aria/tabs", - "@react-aria/tooltip", - "@react-aria/utils", - "@react-stately/collections", - "@react-stately/list", - "@react-stately/menu", - "@react-stately/select", - "@react-stately/tabs", - "@react-stately/tooltip", - "@react-stately/tree", - "@react-types/dialog", - "@react-types/menu", - "@react-types/overlays", - "@react-types/shared", - "@react-types/tabs" - ] + "semanticCommits": "disabled" } diff --git a/src/App.tsx b/src/App.tsx index bcd049b1..fc12af39 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,7 +22,6 @@ import { useLocation, } from "react-router-dom"; import * as Sentry from "@sentry/react"; -import { OverlayProvider } from "@react-aria/overlays"; import { History } from "history"; import { TooltipProvider } from "@vector-im/compound-web"; @@ -92,23 +91,21 @@ export const App: FC = ({ history }) => { - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/Banner.module.css b/src/Banner.module.css deleted file mode 100644 index cd1b5272..00000000 --- a/src/Banner.module.css +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.banner { - flex: 1; - border-radius: 8px; - padding: 16px; - background-color: var(--cpd-color-bg-subtle-primary); -} diff --git a/src/FullScreenView.tsx b/src/FullScreenView.tsx index 4df2f39e..c6d8248f 100644 --- a/src/FullScreenView.tsx +++ b/src/FullScreenView.tsx @@ -20,9 +20,10 @@ import classNames from "classnames"; import { Trans, useTranslation } from "react-i18next"; import * as Sentry from "@sentry/react"; import { logger } from "matrix-js-sdk/src/logger"; +import { Button } from "@vector-im/compound-web"; import { Header, HeaderLogo, LeftNav, RightNav } from "./Header"; -import { LinkButton, Button } from "./button"; +import { LinkButton } from "./button"; import styles from "./FullScreenView.module.css"; import { TranslatedError } from "./TranslatedError"; import { Config } from "./config/Config"; @@ -81,21 +82,11 @@ export const ErrorView: FC = ({ error }) => { {!confineToRoom && (location.pathname === "/" ? ( - ) : ( - + {t("return_home_button")} ))} @@ -122,12 +113,7 @@ export const CrashView: FC = () => { )} - diff --git a/src/ListBox.module.css b/src/ListBox.module.css deleted file mode 100644 index 70da2cd8..00000000 --- a/src/ListBox.module.css +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.listBox { - margin: 0; - padding: 0; - max-height: 150px; - overflow-y: auto; - list-style: none; - background-color: transparent; - border: 1px solid var(--cpd-color-border-interactive-secondary); - background-color: var(--cpd-color-bg-canvas-default); - border-radius: 8px; -} - -.option { - display: flex; - align-items: center; - justify-content: space-between; - background-color: transparent; - color: var(--cpd-color-text-primary); - padding: 8px 16px; - outline: none; - cursor: pointer; - font-size: var(--font-size-body); - min-height: 32px; -} - -.option.focused { - background-color: rgba(111, 120, 130, 0.2); -} - -.option.disabled { - color: var(--cpd-color-text-disabled); - background-color: var(--stopgap-bgColor3); -} diff --git a/src/ListBox.tsx b/src/ListBox.tsx deleted file mode 100644 index ea6e686b..00000000 --- a/src/ListBox.tsx +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - MutableRefObject, - PointerEvent, - ReactNode, - useCallback, - useRef, -} from "react"; -import { useListBox, useOption, AriaListBoxOptions } from "@react-aria/listbox"; -import { ListState } from "@react-stately/list"; -import { Node } from "@react-types/shared"; -import classNames from "classnames"; - -import styles from "./ListBox.module.css"; - -interface ListBoxProps extends AriaListBoxOptions { - optionClassName: string; - state: ListState; - className?: string; - listBoxRef?: MutableRefObject; -} - -export function ListBox({ - state, - optionClassName, - className, - listBoxRef, - ...rest -}: ListBoxProps): ReactNode { - const ref = useRef(null); - - const listRef = listBoxRef ?? ref; - - const { listBoxProps } = useListBox(rest, state, listRef); - - return ( -
    - {[...state.collection].map((item) => ( -
- ); -} - -interface OptionProps { - className: string; - state: ListState; - item: Node; -} - -function Option({ item, state, className }: OptionProps): ReactNode { - const ref = useRef(null); - const { optionProps, isSelected, isFocused, isDisabled } = useOption( - { key: item.key }, - state, - ref, - ); - - // Hack: remove the onPointerUp event handler and re-wire it to - // onClick. Chrome Android triggers a click event after the onpointerup - // event which leaks through to elements underneath the z-indexed select - // popover. preventDefault / stopPropagation don't have any effect, even - // adding just a dummy onClick handler still doesn't work, but it's fine - // if we handle just onClick. - // https://github.com/vector-im/element-call/issues/762 - const origPointerUp = optionProps.onPointerUp; - delete optionProps.onPointerUp; - optionProps.onClick = useCallback( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - (e) => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - origPointerUp(e as unknown as PointerEvent); - }, - [origPointerUp], - ); - - return ( -
  • - {item.rendered} -
  • - ); -} diff --git a/src/Menu.module.css b/src/Menu.module.css deleted file mode 100644 index bca12a8f..00000000 --- a/src/Menu.module.css +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.menu { - width: 100%; - padding: 0; - margin: 0; - list-style: none; -} - -.menuItem { - cursor: pointer; - height: 48px; - display: flex; - align-items: center; - padding: 0 12px; - color: var(--cpd-color-text-primary); - font-size: var(--font-size-body); - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} - -.menuItem > * { - margin: 0 10px 0 0; -} - -.menuItem > :last-child { - margin-right: 0; -} - -.menuItem.focused, -.menuItem:hover { - background-color: var(--cpd-color-bg-action-secondary-hovered); -} - -.menuItem:active { - background-color: var(--cpd-color-bg-action-secondary-pressed); -} - -.menuItem.focused:first-child, -.menuItem:hover:first-child { - border-top-left-radius: 8px; - border-top-right-radius: 8px; -} - -.menuItem.focused:last-child, -.menuItem:hover:last-child { - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; -} - -.checkIcon { - position: absolute; - right: 16px; -} - -.checkIcon * { - stroke: var(--cpd-color-text-primary); -} diff --git a/src/Menu.tsx b/src/Menu.tsx deleted file mode 100644 index cfc0bc53..00000000 --- a/src/Menu.tsx +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { Key, ReactNode, useRef, useState } from "react"; -import { AriaMenuOptions, useMenu, useMenuItem } from "@react-aria/menu"; -import { TreeState, useTreeState } from "@react-stately/tree"; -import { mergeProps } from "@react-aria/utils"; -import { useFocus } from "@react-aria/interactions"; -import classNames from "classnames"; -import { Node } from "@react-types/shared"; - -import styles from "./Menu.module.css"; - -interface MenuProps extends AriaMenuOptions { - className?: string; - onClose: () => void; - onAction: (value: Key) => void; - label?: string; -} - -export function Menu({ - className, - onAction, - onClose, - label, - ...rest -}: MenuProps): ReactNode { - const state = useTreeState({ ...rest, selectionMode: "none" }); - const menuRef = useRef(null); - const { menuProps } = useMenu(rest, state, menuRef); - - return ( -
      - {[...state.collection].map((item) => ( - - ))} -
    - ); -} - -interface MenuItemProps { - item: Node; - state: TreeState; - onAction: (value: Key) => void; - onClose: () => void; -} - -function MenuItem({ - item, - state, - onAction, - onClose, -}: MenuItemProps): ReactNode { - const ref = useRef(null); - const { menuItemProps } = useMenuItem( - { - key: item.key, - onAction, - onClose, - }, - state, - ref, - ); - - const [isFocused, setFocused] = useState(false); - const { focusProps } = useFocus({ onFocusChange: setFocused }); - - return ( -
  • - {item.rendered} -
  • - ); -} diff --git a/src/Modal.module.css b/src/Modal.module.css index d6af51df..e59fe438 100644 --- a/src/Modal.module.css +++ b/src/Modal.module.css @@ -134,6 +134,10 @@ body[data-platform="ios"] .drawer { padding-block: var(--cpd-space-9x) var(--cpd-space-10x); } +.modal.tabbed .body { + padding-block-start: 0; +} + .handle { content: ""; position: absolute; diff --git a/src/Modal.tsx b/src/Modal.tsx index 4328dad2..e2d0ba14 100644 --- a/src/Modal.tsx +++ b/src/Modal.tsx @@ -15,7 +15,6 @@ limitations under the License. */ import { FC, ReactNode, useCallback } from "react"; -import { AriaDialogProps } from "@react-types/dialog"; import { useTranslation } from "react-i18next"; import { Root as DialogRoot, @@ -35,8 +34,7 @@ import styles from "./Modal.module.css"; import overlayStyles from "./Overlay.module.css"; import { useMediaQuery } from "./useMediaQuery"; -// TODO: Support tabs -export interface Props extends AriaDialogProps { +export interface Props { title: string; children: ReactNode; className?: string; @@ -52,6 +50,11 @@ export interface Props extends AriaDialogProps { * will be non-dismissable. */ onDismiss?: () => void; + /** + * Whether the modal content has tabs. + */ + // TODO: Better tabs support + tabbed?: boolean; } /** @@ -64,6 +67,7 @@ export const Modal: FC = ({ className, open, onDismiss, + tabbed, ...rest }) => { const { t } = useTranslation(); @@ -92,6 +96,7 @@ export const Modal: FC = ({ overlayStyles.overlay, styles.modal, styles.drawer, + { [styles.tabbed]: tabbed }, )} {...rest} > @@ -123,6 +128,7 @@ export const Modal: FC = ({ overlayStyles.animate, styles.modal, styles.dialog, + { [styles.tabbed]: tabbed }, )} >
    diff --git a/src/Tooltip.module.css b/src/Tooltip.module.css deleted file mode 100644 index 07219f75..00000000 --- a/src/Tooltip.module.css +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.tooltip { - background-color: var(--cpd-color-bg-subtle-secondary); - flex-direction: row; - justify-content: center; - align-items: center; - padding: 10px; - color: var(--cpd-color-text-primary); - border-radius: 8px; - max-width: 135px; - width: max-content; - font-size: var(--font-size-caption); - font-weight: 500; - text-align: center; -} diff --git a/src/Tooltip.tsx b/src/Tooltip.tsx deleted file mode 100644 index adaa18b3..00000000 --- a/src/Tooltip.tsx +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { - ForwardedRef, - forwardRef, - ReactElement, - ReactNode, - useRef, -} from "react"; -import { - TooltipTriggerState, - useTooltipTriggerState, -} from "@react-stately/tooltip"; -import { FocusableProvider } from "@react-aria/focus"; -import { useTooltipTrigger, useTooltip } from "@react-aria/tooltip"; -import { mergeProps, useObjectRef } from "@react-aria/utils"; -import classNames from "classnames"; -import { OverlayContainer, useOverlayPosition } from "@react-aria/overlays"; -import { Placement } from "@react-types/overlays"; - -import styles from "./Tooltip.module.css"; - -interface TooltipProps { - className?: string; - state: TooltipTriggerState; - children: ReactNode; -} - -const Tooltip = forwardRef( - ( - { state, className, children, ...rest }: TooltipProps, - ref: ForwardedRef, - ) => { - const { tooltipProps } = useTooltip(rest, state); - - return ( -
    - {children} -
    - ); - }, -); - -Tooltip.displayName = "Tooltip"; - -interface TooltipTriggerProps { - children: ReactElement; - placement?: Placement; - delay?: number; - tooltip: () => string; -} - -export const TooltipTrigger = forwardRef( - ( - { children, placement, tooltip, ...rest }: TooltipTriggerProps, - ref: ForwardedRef, - ) => { - const tooltipTriggerProps = { delay: 250, ...rest }; - const tooltipState = useTooltipTriggerState(tooltipTriggerProps); - const triggerRef = useObjectRef(ref); - const overlayRef = useRef(null); - const { triggerProps, tooltipProps } = useTooltipTrigger( - tooltipTriggerProps, - tooltipState, - triggerRef, - ); - - const { overlayProps } = useOverlayPosition({ - placement: placement || "top", - targetRef: triggerRef, - overlayRef, - isOpen: tooltipState.isOpen, - offset: 12, - }); - - return ( - - ( - children.props, - rest, - )} - /> - {tooltipState.isOpen && ( - - - {tooltip()} - - - )} - - ); - }, -); - -TooltipTrigger.displayName = "TooltipTrigger"; diff --git a/src/UserMenu.module.css b/src/UserMenu.module.css index 575b71b9..d4e06037 100644 --- a/src/UserMenu.module.css +++ b/src/UserMenu.module.css @@ -21,6 +21,14 @@ limitations under the License. flex-shrink: 0; } +.userButton { + appearance: none; + background: none; + border: none; + margin: 0; + cursor: pointer; +} + .userButton svg * { fill: var(--cpd-color-icon-primary); } diff --git a/src/UserMenu.tsx b/src/UserMenu.tsx index 7cab4575..55ccc2c0 100644 --- a/src/UserMenu.tsx +++ b/src/UserMenu.tsx @@ -14,21 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { FC, ReactNode, useCallback, useMemo } from "react"; -import { Item } from "@react-stately/collections"; +import { FC, useMemo, useState } from "react"; import { useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; +import { Menu, MenuItem } from "@vector-im/compound-web"; -import { Button, LinkButton } from "./button"; -import { PopoverMenuTrigger } from "./popover/PopoverMenu"; -import { Menu } from "./Menu"; -import { TooltipTrigger } from "./Tooltip"; +import { LinkButton } from "./button"; import { Avatar, Size } from "./Avatar"; import UserIcon from "./icons/User.svg?react"; import SettingsIcon from "./icons/Settings.svg?react"; import LoginIcon from "./icons/Login.svg?react"; import LogoutIcon from "./icons/Logout.svg?react"; -import { Body } from "./typography/Typography"; import styles from "./UserMenu.module.css"; interface Props { @@ -91,7 +87,7 @@ export const UserMenu: FC = ({ return arr; }, [isAuthenticated, isPasswordlessUser, displayName, preventNavigation, t]); - const tooltip = useCallback(() => t("common.profile"), [t]); + const [open, setOpen] = useState(false); if (!isAuthenticated) { return ( @@ -102,10 +98,15 @@ export const UserMenu: FC = ({ } return ( - - - - - { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (props: any): ReactNode => ( - - {items.map(({ key, icon: Icon, label, dataTestid }) => ( - - - {label} - - ))} - - ) + } - + > + {items.map(({ key, icon: Icon, label, dataTestid }) => ( + onAction(key)} + /> + ))} + ); }; diff --git a/src/auth/LoginPage.tsx b/src/auth/LoginPage.tsx index 167d30b2..5db36781 100644 --- a/src/auth/LoginPage.tsx +++ b/src/auth/LoginPage.tsx @@ -17,11 +17,11 @@ limitations under the License. import { FC, FormEvent, useCallback, useRef, useState } from "react"; import { useHistory, useLocation, Link } from "react-router-dom"; import { Trans, useTranslation } from "react-i18next"; +import { Button } from "@vector-im/compound-web"; import Logo from "../icons/LogoLarge.svg?react"; import { useClient } from "../ClientContext"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; -import { Button } from "../button"; import styles from "./LoginPage.module.css"; import { useInteractiveLogin } from "./useInteractiveLogin"; import { usePageTitle } from "../usePageTitle"; diff --git a/src/auth/RegisterPage.tsx b/src/auth/RegisterPage.tsx index 467530d0..fc3d5b00 100644 --- a/src/auth/RegisterPage.tsx +++ b/src/auth/RegisterPage.tsx @@ -28,9 +28,9 @@ import { captureException } from "@sentry/react"; import { sleep } from "matrix-js-sdk/src/utils"; import { Trans, useTranslation } from "react-i18next"; import { logger } from "matrix-js-sdk/src/logger"; +import { Button } from "@vector-im/compound-web"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; -import { Button } from "../button"; import { useClientLegacy } from "../ClientContext"; import { useInteractiveRegistration } from "./useInteractiveRegistration"; import styles from "./LoginPage.module.css"; diff --git a/src/auth/useRecaptcha.ts b/src/auth/useRecaptcha.ts index 03a9fe49..00daa18c 100644 --- a/src/auth/useRecaptcha.ts +++ b/src/auth/useRecaptcha.ts @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// import "@types/grecaptcha"; + import { useEffect, useCallback, useRef, useState } from "react"; import { randomString } from "matrix-js-sdk/src/randomstring"; import { useTranslation } from "react-i18next"; @@ -23,7 +23,6 @@ import { translatedError } from "../TranslatedError"; declare global { interface Window { mxOnRecaptchaLoaded: () => void; - // grecaptcha: any; } } diff --git a/src/button/Button.module.css b/src/button/Button.module.css index 7f915648..516725be 100644 --- a/src/button/Button.module.css +++ b/src/button/Button.module.css @@ -1,5 +1,5 @@ /* -Copyright 2021 New Vector Ltd +Copyright 2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,240 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.button, -.toolbarButton, -.toolbarButtonSecondary, -.iconButton, -.iconCopyButton, -.secondary, -.secondaryHangup, -.copyButton, -.dropdownButton { - position: relative; - display: flex; - justify-content: center; - align-items: center; - background-color: transparent; - padding: 0; - border: none; - cursor: pointer; - text-decoration: none; - box-sizing: border-box; -} - -.secondary, -.secondaryHangup, -.button, -.copyButton { - padding: 8px 20px; - border-radius: 8px; - font-size: var(--font-size-body); - font-weight: 600; -} - -.button { - color: var(--stopgap-color-on-solid-accent); - background-color: var(--cpd-color-text-action-accent); -} - -.button:focus-visible, -.toolbarButton:focus-visible, -.toolbarButtonSecondary:focus-visible, -.iconButton:focus-visible, -.iconCopyButton:focus-visible, -.secondary:focus-visible, -.secondaryHangup:focus-visible, -.copyButton:focus-visible { - outline: auto; -} - -.toolbarButton:disabled { - background-color: var(--cpd-color-bg-action-primary-disabled); - box-shadow: none; -} - -.toolbarButton, -.toolbarButtonSecondary { - width: 50px; - height: 50px; - border-radius: 50px; - background-color: var(--cpd-color-bg-canvas-default); - color: var(--cpd-color-icon-primary); - border: 1px solid var(--cpd-color-gray-400); - box-shadow: var(--subtle-drop-shadow); -} - -.toolbarButton.on, -.toolbarButton.off { - background-color: var(--cpd-color-bg-action-primary-rest); - color: var(--cpd-color-icon-on-solid-primary); -} - -.toolbarButtonSecondary.on { - background-color: var(--cpd-color-text-success-primary); -} - -.toolbarButton:active, -.toolbarButtonSecondary:active { - background-color: var(--cpd-color-bg-subtle-primary); - border: none; - box-shadow: none; -} - -.toolbarButton.on:active, -.toolbarButton.off:active { - background-color: var(--cpd-color-bg-action-primary-pressed); -} - -.iconButton:not(.stroke) svg * { - fill: var(--cpd-color-bg-action-primary-rest); -} - -.iconButton:not(.stroke):tertiary svg * { - fill: var(--cpd-color-icon-accent-tertiary); -} - -.iconButton.on:not(.stroke) svg * { - fill: var(--cpd-color-icon-accent-tertiary); -} - -.iconButton.on.stroke svg * { - stroke: var(--cpd-color-icon-accent-tertiary); -} - -.hangupButton { - background-color: var(--cpd-color-bg-critical-primary); - border-color: var(--cpd-color-border-critical-subtle); +.endCall > svg { color: var(--stopgap-color-on-solid-accent); } - -.hangupButton:active { - background-color: var(--cpd-color-bg-critical-pressed); -} - -.secondary, -.copyButton { - color: var(--cpd-color-text-action-accent); - border: 2px solid var(--cpd-color-text-action-accent); - background-color: transparent; -} - -.secondaryHangup { - color: var(--cpd-color-text-critical-primary); - border: 2px solid var(--cpd-color-border-critical-primary); - background-color: transparent; -} - -.copyButton.secondaryCopy { - color: var(--cpd-color-text-primary); - border-color: var(--cpd-color-border-interactive-primary); -} - -.copyButton { - width: 100%; - height: 40px; - transition: - border-color 250ms, - background-color 250ms; -} - -.copyButton span { - font-weight: 600; - font-size: var(--font-size-body); - margin-right: 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.copyButton svg { - flex-shrink: 0; -} - -.copyButton:not(.on) svg * { - fill: var(--cpd-color-icon-accent-tertiary); -} - -.copyButton.on { - border-color: transparent; - background-color: var(--cpd-color-text-action-accent); - color: white; -} - -.copyButton.on svg * { - stroke: white; -} - -.copyButton.secondaryCopy:not(.on) svg * { - fill: var(--cpd-color-bg-action-primary-rest); -} - -.iconCopyButton svg * { - fill: var(--cpd-color-icon-secondary); -} - -.iconCopyButton.on svg *, -.iconCopyButton.on:hover svg * { - fill: transparent; - stroke: var(--cpd-color-text-action-accent); -} - -.dropdownButton { - color: var(--cpd-color-text-primary); - padding: 2px 8px; - border-radius: 8px; -} - -.dropdownButton:active, -.dropdownButton.on { - background-color: var(--cpd-color-bg-action-secondary-pressed); -} - -.dropdownButton svg { - margin-left: 8px; -} - -.dropdownButton svg * { - fill: var(--cpd-color-icon-primary); -} - -.lg { - height: 40px; -} - -.linkButton { - background-color: transparent; - border: none; - color: var(--cpd-color-text-action-accent); - cursor: pointer; -} - -@media (hover: hover) { - .toolbarButton:hover, - .toolbarButtonSecondary:hover { - background-color: var(--cpd-color-bg-subtle-primary); - border: none; - box-shadow: none; - } - - .toolbarButton.on:hover, - .toolbarButton.off:hover { - background-color: var(--cpd-color-bg-action-primary-hovered); - } - - .iconButton:not(.stroke):hover svg * { - fill: var(--cpd-color-icon-accent-tertiary); - } - - .hangupButton:hover { - background-color: var(--cpd-color-bg-critical-hovered); - } - - .iconCopyButton:hover svg * { - fill: var(--cpd-color-icon-accent-tertiary); - } - - .dropdownButton:hover { - background-color: var(--cpd-color-bg-action-secondary-hovered); - } -} diff --git a/src/button/Button.tsx b/src/button/Button.tsx index 10c4dfd0..db578494 100644 --- a/src/button/Button.tsx +++ b/src/button/Button.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 - 2023 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,13 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import { FC, forwardRef } from "react"; -import { PressEvent } from "@react-types/shared"; +import { ComponentPropsWithoutRef, FC } from "react"; import classNames from "classnames"; -import { useButton } from "@react-aria/button"; -import { mergeProps, useObjectRef } from "@react-aria/utils"; import { useTranslation } from "react-i18next"; -import { Tooltip } from "@vector-im/compound-web"; +import { Button as CpdButton, Tooltip } from "@vector-im/compound-web"; import { MicOnSolidIcon, MicOffSolidIcon, @@ -28,120 +25,15 @@ import { EndCallIcon, ShareScreenSolidIcon, SettingsSolidIcon, - ChevronDownIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; import styles from "./Button.module.css"; -export type ButtonVariant = - | "default" - | "toolbar" - | "toolbarSecondary" - | "icon" - | "secondary" - | "copy" - | "secondaryCopy" - | "iconCopy" - | "secondaryHangup" - | "dropdown" - | "link"; - -export const variantToClassName = { - default: [styles.button], - toolbar: [styles.toolbarButton], - toolbarSecondary: [styles.toolbarButtonSecondary], - icon: [styles.iconButton], - secondary: [styles.secondary], - copy: [styles.copyButton], - secondaryCopy: [styles.secondaryCopy, styles.copyButton], - iconCopy: [styles.iconCopyButton], - secondaryHangup: [styles.secondaryHangup], - dropdown: [styles.dropdownButton], - link: [styles.linkButton], -}; - -export type ButtonSize = "lg"; - -export const sizeToClassName: { lg: string[] } = { - lg: [styles.lg], -}; -interface Props { - variant: ButtonVariant; - size: ButtonSize; - on: () => void; - off: () => void; - iconStyle: string; - className: string; - children: Element[]; - onPress: (e: PressEvent) => void; - onPressStart: (e: PressEvent) => void; - disabled: boolean; - // TODO: add all props for - ); - }, -); - -Button.displayName = "Button"; - -export const MicButton: FC<{ - muted: boolean; - // TODO: add all props for + ); }; -export const VideoButton: FC<{ +interface VideoButtonProps extends ComponentPropsWithoutRef<"button"> { muted: boolean; - // TODO: add all props for + ); }; -export const ScreenshareButton: FC<{ +interface ShareScreenButtonProps extends ComponentPropsWithoutRef<"button"> { enabled: boolean; - className?: string; - // TODO: add all props for + ); }; -export const HangupButton: FC<{ - className?: string; - // TODO: add all props for + ); }; -export const SettingsButton: FC<{ - className?: string; - // TODO: add all props for + ); }; diff --git a/src/button/CopyButton.tsx b/src/button/CopyButton.tsx deleted file mode 100644 index 247cd3c5..00000000 --- a/src/button/CopyButton.tsx +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { useTranslation } from "react-i18next"; -import useClipboard from "react-use-clipboard"; -import { FC } from "react"; - -import CheckIcon from "../icons/Check.svg?react"; -import CopyIcon from "../icons/Copy.svg?react"; -import { Button, ButtonVariant } from "./Button"; - -interface Props { - value: string; - children?: JSX.Element | string; - className?: string; - variant?: ButtonVariant; - copiedMessage?: string; -} - -export const CopyButton: FC = ({ - value, - children, - className, - variant, - copiedMessage, - ...rest -}) => { - const { t } = useTranslation(); - const [isCopied, setCopied] = useClipboard(value, { successDuration: 3000 }); - - return ( - - ); -}; diff --git a/src/button/Link.tsx b/src/button/Link.tsx new file mode 100644 index 00000000..686cfa83 --- /dev/null +++ b/src/button/Link.tsx @@ -0,0 +1,61 @@ +/* +Copyright 2024 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import { + ComponentPropsWithoutRef, + forwardRef, + MouseEvent, + useCallback, + useMemo, +} from "react"; +import { Link as CpdLink } from "@vector-im/compound-web"; +import { useHistory } from "react-router-dom"; +import { createPath, LocationDescriptor, Path } from "history"; + +export function useLink( + to: LocationDescriptor, +): [Path, (e: MouseEvent) => void] { + const history = useHistory(); + const path = useMemo( + () => (typeof to === "string" ? to : createPath(to)), + [to], + ); + const onClick = useCallback( + (e: MouseEvent) => { + e.preventDefault(); + history.push(to); + }, + [history, to], + ); + + return [path, onClick]; +} + +type Props = Omit< + ComponentPropsWithoutRef, + "href" | "onClick" +> & { to: LocationDescriptor }; + +/** + * A version of Compound's link component that integrates with our router setup. + */ +export const Link = forwardRef(function Link( + { to, ...props }, + ref, +) { + const [path, onClick] = useLink(to); + return ; +}); diff --git a/src/button/LinkButton.tsx b/src/button/LinkButton.tsx index eb30441c..3cff744d 100644 --- a/src/button/LinkButton.tsx +++ b/src/button/LinkButton.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,45 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { FC, HTMLAttributes } from "react"; -import { Link } from "react-router-dom"; -import classNames from "classnames"; -import * as H from "history"; +import { ComponentPropsWithoutRef, forwardRef } from "react"; +import { Button } from "@vector-im/compound-web"; +import { LocationDescriptor } from "history"; -import { - variantToClassName, - sizeToClassName, - ButtonVariant, - ButtonSize, -} from "./Button"; +import { useLink } from "./Link"; -interface Props extends HTMLAttributes { - children: JSX.Element | string; - to: H.LocationDescriptor | ((location: H.Location) => H.LocationDescriptor); - size?: ButtonSize; - variant?: ButtonVariant; - className?: string; -} +type Props = Omit< + ComponentPropsWithoutRef>, + "as" | "href" +> & { to: LocationDescriptor }; -export const LinkButton: FC = ({ - children, - to, - size, - variant, - className, - ...rest -}) => { - return ( - - {children} - - ); -}; +/** + * A version of Compound's button component that acts as a link and integrates + * with our router setup. + */ +export const LinkButton = forwardRef( + function LinkButton({ to, ...props }, ref) { + const [path, onClick] = useLink(to); + return
    -
    ); }; diff --git a/src/home/JoinExistingCallModal.tsx b/src/home/JoinExistingCallModal.tsx index 85d4adde..bc60b8fb 100644 --- a/src/home/JoinExistingCallModal.tsx +++ b/src/home/JoinExistingCallModal.tsx @@ -14,19 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { PressEvent } from "@react-types/shared"; import { useTranslation } from "react-i18next"; -import { FC } from "react"; +import { FC, MouseEvent } from "react"; +import { Button } from "@vector-im/compound-web"; import { Modal } from "../Modal"; -import { Button } from "../button"; import { FieldRow } from "../input/Input"; import styles from "./JoinExistingCallModal.module.css"; interface Props { open: boolean; onDismiss: () => void; - onJoin: (e: PressEvent) => void; + onJoin: (e: MouseEvent) => void; } export const JoinExistingCallModal: FC = ({ @@ -44,8 +43,8 @@ export const JoinExistingCallModal: FC = ({ >

    {t("join_existing_call_modal.text")}

    - - + diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index f3b8d229..3335acd2 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -20,6 +20,7 @@ import { MatrixClient } from "matrix-js-sdk/src/client"; import { useTranslation } from "react-i18next"; import { Heading } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/src/logger"; +import { Button } from "@vector-im/compound-web"; import { createRoom, @@ -32,7 +33,6 @@ import { Header, HeaderLogo, LeftNav, RightNav } from "../Header"; import commonStyles from "./common.module.css"; import styles from "./RegisteredView.module.css"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; -import { Button } from "../button"; import { CallList } from "./CallList"; import { UserMenuContainer } from "../UserMenuContainer"; import { JoinExistingCallModal } from "./JoinExistingCallModal"; diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index 82e44991..ae222737 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -18,14 +18,13 @@ import { FC, useCallback, useState, FormEventHandler } from "react"; import { useHistory } from "react-router-dom"; import { randomString } from "matrix-js-sdk/src/randomstring"; import { Trans, useTranslation } from "react-i18next"; -import { Heading } from "@vector-im/compound-web"; +import { Button, Heading } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/src/logger"; import { useClient } from "../ClientContext"; import { Header, HeaderLogo, LeftNav, RightNav } from "../Header"; import { UserMenuContainer } from "../UserMenuContainer"; import { FieldRow, InputField, ErrorMessage } from "../input/Input"; -import { Button } from "../button"; import { createRoom, getRelativeRoomUrl, diff --git a/src/icons/ArrowDown.svg b/src/icons/ArrowDown.svg deleted file mode 100644 index 37713a28..00000000 --- a/src/icons/ArrowDown.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/icons/Audio.svg b/src/icons/Audio.svg deleted file mode 100644 index 0be0da92..00000000 --- a/src/icons/Audio.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/icons/Copy.svg b/src/icons/Copy.svg deleted file mode 100644 index e5397118..00000000 --- a/src/icons/Copy.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/icons/Developer.svg b/src/icons/Developer.svg deleted file mode 100644 index 7d1a095f..00000000 --- a/src/icons/Developer.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/icons/Edit.svg b/src/icons/Edit.svg deleted file mode 100644 index b9600405..00000000 --- a/src/icons/Edit.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/icons/Feedback.svg b/src/icons/Feedback.svg deleted file mode 100644 index d3842163..00000000 --- a/src/icons/Feedback.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/icons/Overflow.svg b/src/icons/Overflow.svg deleted file mode 100644 index 3d7f54c1..00000000 --- a/src/icons/Overflow.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/icons/Video.svg b/src/icons/Video.svg deleted file mode 100644 index f03bca26..00000000 --- a/src/icons/Video.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/index.css b/src/index.css index 816def33..134d2a57 100644 --- a/src/index.css +++ b/src/index.css @@ -20,9 +20,12 @@ limitations under the License. Therefore we define a unicode-range to load which excludes the glyphs (to avoid having to maintain a fork of Inter). */ -@import "normalize.css/normalize.css"; -@import "@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css"; -@import "@vector-im/compound-web/dist/style.css"; +@layer normalize, compound-legacy, compound; + +@import url("normalize.css/normalize.css") layer(normalize); +@import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css") +layer(compound); +@import url("@vector-im/compound-web/dist/style.css") layer(compound.components); :root { --font-scale: 1; @@ -195,87 +198,89 @@ body[data-platform="desktop"] { --cpd-font-family-sans: "Inter", sans-serif; } -h1, -h2, -h3, -h4, -h5, -h6, -p, -a { - margin-top: 0; -} +@layer compound-legacy { + h1, + h2, + h3, + h4, + h5, + h6, + p, + a { + margin-top: 0; + } -/* Headline Semi Bold */ -h1 { - font-weight: 600; - font-size: var(--font-size-headline); -} + /* Headline Semi Bold */ + h1 { + font-weight: 600; + font-size: var(--font-size-headline); + } -/* Title */ -h2 { - font-weight: 600; - font-size: var(--font-size-title); -} + /* Title */ + h2 { + font-weight: 600; + font-size: var(--font-size-title); + } -/* Subtitle */ -h3 { - font-weight: 600; - font-size: var(--font-size-subtitle); -} + /* Subtitle */ + h3 { + font-weight: 600; + font-size: var(--font-size-subtitle); + } -/* Body Semi Bold */ -h4 { - font-weight: 600; - font-size: var(--font-size-body); -} + /* Body Semi Bold */ + h4 { + font-weight: 600; + font-size: var(--font-size-body); + } -h1, -h2, -h3 { - line-height: 1.2; -} + h1, + h2, + h3 { + line-height: 1.2; + } -/* Body */ -p { - font-size: var(--font-size-body); - line-height: var(--font-size-title); -} + /* Body */ + p { + font-size: var(--font-size-body); + line-height: var(--font-size-title); + } -a { - color: var(--cpd-color-text-action-accent); - text-decoration: none; -} + a { + color: var(--cpd-color-text-action-accent); + text-decoration: none; + } -a:hover, -a:active { - opacity: 0.8; -} + a:hover, + a:active { + opacity: 0.8; + } -hr { - width: calc(100% - 24px); - border: none; - border-top: 1px solid var(--cpd-color-border-interactive-secondary); - color: var(--cpd-color-border-interactive-secondary); - overflow: visible; - text-align: center; - height: 5px; - font-weight: 600; - font-size: var(--font-size-body); - line-height: 24px; - margin: 0 12px; -} + hr { + width: calc(100% - 24px); + border: none; + border-top: 1px solid var(--cpd-color-border-interactive-secondary); + color: var(--cpd-color-border-interactive-secondary); + overflow: visible; + text-align: center; + height: 5px; + font-weight: 600; + font-size: var(--font-size-body); + line-height: 24px; + margin: 0 12px; + } -summary { - font-size: var(--font-size-body); -} + summary { + font-size: var(--font-size-body); + } -details > :not(summary) { - margin-left: var(--font-size-body); -} + details > :not(summary) { + margin-left: var(--font-size-body); + } -details[open] > summary { - margin-bottom: var(--font-size-body); + details[open] > summary { + margin-bottom: var(--font-size-body); + } } #root > [data-overlay-container] { diff --git a/src/input/AvatarInputField.module.css b/src/input/AvatarInputField.module.css index 49324d06..89227c66 100644 --- a/src/input/AvatarInputField.module.css +++ b/src/input/AvatarInputField.module.css @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,45 +15,30 @@ limitations under the License. */ .avatarInputField { - display: flex; - flex-direction: column; - justify-content: center; -} - -.avatarContainer { position: relative; margin-bottom: 8px; } +.avatar { + display: block; +} + .fileInput { - width: 0.1px; - height: 0.1px; - opacity: 0; - overflow: hidden; + display: none; +} + +.edit { + border-radius: var(--cpd-radius-pill-effect); + padding: 2px; + background: var(--cpd-color-bg-canvas-default); position: absolute; - z-index: -1; + inset-block-end: -2px; + inset-inline-end: -2px; } -.fileInput:focus + .fileInputButton { - outline: auto; -} - -.fileInputButton { - position: absolute; - bottom: 11px; - right: -4px; - background-color: var(--cpd-color-subtle-primary); - width: 20px; - height: 20px; - border-radius: 10px; - display: flex; - justify-content: center; - align-items: center; - cursor: pointer; -} - -.removeButton { - color: var(--cpd-color-text-action-accent); - font-size: var(--font-size-caption); - padding: 6px 0; +.edit button { + min-block-size: 0; + block-size: var(--cpd-space-7x); + inline-size: var(--cpd-space-7x); + padding: var(--cpd-space-1x); } diff --git a/src/input/AvatarInputField.tsx b/src/input/AvatarInputField.tsx index 8e2af744..e21637f7 100644 --- a/src/input/AvatarInputField.tsx +++ b/src/input/AvatarInputField.tsx @@ -1,5 +1,5 @@ /* -Copyright 2022 New Vector Ltd +Copyright 2022-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,21 +14,25 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { useObjectRef } from "@react-aria/utils"; import { AllHTMLAttributes, useEffect, useCallback, useState, - forwardRef, ChangeEvent, + useRef, + FC, } from "react"; import classNames from "classnames"; import { useTranslation } from "react-i18next"; +import { Button, Menu, MenuItem } from "@vector-im/compound-web"; +import { + DeleteIcon, + EditIcon, + ShareIcon, +} from "@vector-im/compound-design-tokens/assets/web/icons"; import { Avatar, Size } from "../Avatar"; -import { Button } from "../button"; -import EditIcon from "../icons/Edit.svg?react"; import styles from "./AvatarInputField.module.css"; interface Props extends AllHTMLAttributes { @@ -40,89 +44,115 @@ interface Props extends AllHTMLAttributes { onRemoveAvatar: () => void; } -export const AvatarInputField = forwardRef( - ( - { - id, - label, - className, - avatarUrl, - userId, - displayName, - onRemoveAvatar, - ...rest - }, - ref, - ) => { - const { t } = useTranslation(); +export const AvatarInputField: FC = ({ + id, + label, + className, + avatarUrl, + userId, + displayName, + onRemoveAvatar, + ...rest +}) => { + const { t } = useTranslation(); - const [removed, setRemoved] = useState(false); - const [objUrl, setObjUrl] = useState(undefined); + const [removed, setRemoved] = useState(false); + const [objUrl, setObjUrl] = useState(undefined); + const [menuOpen, setMenuOpen] = useState(false); - const fileInputRef = useObjectRef(ref); + const fileInputRef = useRef(null); - useEffect(() => { - const currentInput = fileInputRef.current; + useEffect(() => { + const currentInput = fileInputRef.current!; - const onChange = (e: Event): void => { - const inputEvent = e as unknown as ChangeEvent; - if (inputEvent.target.files && inputEvent.target.files.length > 0) { - setObjUrl(URL.createObjectURL(inputEvent.target.files[0])); - setRemoved(false); - } else { - setObjUrl(undefined); - } - }; + const onChange = (e: Event): void => { + const inputEvent = e as unknown as ChangeEvent; + if (inputEvent.target.files && inputEvent.target.files.length > 0) { + setObjUrl(URL.createObjectURL(inputEvent.target.files[0])); + setRemoved(false); + } else { + setObjUrl(undefined); + } + }; - currentInput.addEventListener("change", onChange); + currentInput.addEventListener("change", onChange); - return (): void => { - currentInput?.removeEventListener("change", onChange); - }; - }); + return (): void => { + currentInput?.removeEventListener("change", onChange); + }; + }); - const onPressRemoveAvatar = useCallback(() => { - setRemoved(true); - onRemoveAvatar(); - }, [onRemoveAvatar]); + const onSelectUpload = useCallback(() => { + fileInputRef.current!.click(); + }, [fileInputRef]); - return ( -
    -
    - - - {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/966 */} - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
    - {(avatarUrl || objUrl) && !removed && ( - + + + + ) : ( +
    - ); - }, -); + + ); +}; AvatarInputField.displayName = "AvatarInputField"; diff --git a/src/input/SelectInput.module.css b/src/input/SelectInput.module.css deleted file mode 100644 index 472537ff..00000000 --- a/src/input/SelectInput.module.css +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.selectInput { - position: relative; - display: inline-block; - margin-bottom: 28px; - max-width: 444px; -} - -.label { - margin-top: 0; - margin-bottom: 12px; -} - -.selectTrigger { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 12px; - background-color: var(--cpd-color-bg-canvas-default); - border-radius: 8px; - border: 1px solid var(--cpd-color-border-interactive-primary); - font-size: var(--font-size-body); - color: var(--cpd-color-text-primary); - height: 40px; - max-width: 100%; - width: 100%; -} - -.selectTrigger:focus { - outline: auto; -} - -.selectedItem { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding-right: 20px; -} - -.popover { - position: absolute; - margin-top: 5px; - width: 100%; - z-index: 1; -} diff --git a/src/input/SelectInput.tsx b/src/input/SelectInput.tsx deleted file mode 100644 index b2ae3f2f..00000000 --- a/src/input/SelectInput.tsx +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { useRef } from "react"; -import { AriaSelectOptions, HiddenSelect, useSelect } from "@react-aria/select"; -import { useButton } from "@react-aria/button"; -import { useSelectState } from "@react-stately/select"; -import classNames from "classnames"; -import { useTranslation } from "react-i18next"; - -import { Popover } from "../popover/Popover"; -import { ListBox } from "../ListBox"; -import styles from "./SelectInput.module.css"; -import ArrowDownIcon from "../icons/ArrowDown.svg?react"; - -interface Props extends AriaSelectOptions { - className?: string; -} - -export function SelectInput(props: Props): JSX.Element { - const { t } = useTranslation(); - const state = useSelectState(props); - - const ref = useRef(null); - const { labelProps, triggerProps, valueProps, menuProps } = useSelect( - props, - state, - ref, - ); - - const { buttonProps } = useButton(triggerProps, ref); - - return ( -
    -

    - {props.label} -

    - - - {state.isOpen && ( - - - - )} -
    - ); -} diff --git a/src/popover/Popover.module.css b/src/popover/Popover.module.css deleted file mode 100644 index e19d133c..00000000 --- a/src/popover/Popover.module.css +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.popover { - display: flex; - flex-direction: column; - width: 194px; - background: var(--cpd-color-bg-subtle-secondary); - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - border-radius: 8px; -} diff --git a/src/popover/Popover.tsx b/src/popover/Popover.tsx deleted file mode 100644 index 65ec27a6..00000000 --- a/src/popover/Popover.tsx +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { forwardRef, HTMLAttributes } from "react"; -import { DismissButton, useOverlay } from "@react-aria/overlays"; -import { FocusScope } from "@react-aria/focus"; -import classNames from "classnames"; -import { useObjectRef } from "@react-aria/utils"; - -import styles from "./Popover.module.css"; - -interface Props extends HTMLAttributes { - isOpen: boolean; - onClose: () => void; - className?: string; - children?: JSX.Element; -} - -export const Popover = forwardRef( - ({ isOpen = true, onClose, className, children, ...rest }, ref) => { - const popoverRef = useObjectRef(ref); - - const { overlayProps } = useOverlay( - { - isOpen, - onClose, - shouldCloseOnBlur: true, - isDismissable: true, - }, - popoverRef, - ); - - return ( - -
    - {children} - -
    -
    - ); - }, -); - -Popover.displayName = "Popover"; diff --git a/src/popover/PopoverMenu.module.css b/src/popover/PopoverMenu.module.css deleted file mode 100644 index 5c874384..00000000 --- a/src/popover/PopoverMenu.module.css +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.popoverMenuTrigger { - position: relative; - display: inline-block; -} diff --git a/src/popover/PopoverMenu.tsx b/src/popover/PopoverMenu.tsx deleted file mode 100644 index 46913a05..00000000 --- a/src/popover/PopoverMenu.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { forwardRef, useRef } from "react"; -import { useMenuTriggerState } from "@react-stately/menu"; -import { useMenuTrigger } from "@react-aria/menu"; -import { OverlayContainer, useOverlayPosition } from "@react-aria/overlays"; -import { mergeProps, useObjectRef } from "@react-aria/utils"; -import classNames from "classnames"; -import { MenuTriggerProps } from "@react-types/menu"; -import { Placement } from "@react-types/overlays"; - -import styles from "./PopoverMenu.module.css"; -import { Popover } from "./Popover"; - -interface PopoverMenuTriggerProps extends MenuTriggerProps { - children: JSX.Element; - placement: Placement; - className: string; - disableOnState: boolean; - [index: string]: unknown; -} - -export const PopoverMenuTrigger = forwardRef< - HTMLDivElement, - PopoverMenuTriggerProps ->(({ children, placement, className, disableOnState, ...rest }, ref) => { - const popoverMenuState = useMenuTriggerState(rest); - const buttonRef = useObjectRef(ref); - const { menuTriggerProps, menuProps } = useMenuTrigger( - {}, - popoverMenuState, - buttonRef, - ); - - const popoverRef = useRef(null); - - const { overlayProps } = useOverlayPosition({ - targetRef: buttonRef, - overlayRef: popoverRef, - placement: placement || "top", - offset: 5, - isOpen: popoverMenuState.isOpen, - }); - - if ( - !Array.isArray(children) || - children.length > 2 || - typeof children[1] !== "function" - ) { - throw new Error( - "PopoverMenu must have two props. The first being a button and the second being a render prop.", - ); - } - - const [popoverTrigger, popoverMenu] = children; - - return ( -
    - - {popoverMenuState.isOpen && ( - - - {popoverMenu({ - ...menuProps, - autoFocus: popoverMenuState.focusStrategy, - onClose: popoverMenuState.close, - })} - - - )} -
    - ); -}); - -PopoverMenuTrigger.displayName = "PopoverMenuTrigger"; diff --git a/src/room/CallEndedView.module.css b/src/room/CallEndedView.module.css index 12409d4e..9a43ccb4 100644 --- a/src/room/CallEndedView.module.css +++ b/src/room/CallEndedView.module.css @@ -42,9 +42,8 @@ limitations under the License. } .callEndedButton { + margin: auto; margin-top: 54px; - margin-left: 30px; - margin-right: 30px !important; } .submitButton { diff --git a/src/room/CallEndedView.tsx b/src/room/CallEndedView.tsx index 3cb928aa..99686775 100644 --- a/src/room/CallEndedView.tsx +++ b/src/room/CallEndedView.tsx @@ -18,17 +18,19 @@ import { FC, FormEventHandler, ReactNode, useCallback, useState } from "react"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { Trans, useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; +import { Button } from "@vector-im/compound-web"; import styles from "./CallEndedView.module.css"; import feedbackStyle from "../input/FeedbackInput.module.css"; -import { Button, LinkButton } from "../button"; import { useProfile } from "../profile/useProfile"; -import { Body, Link, Headline } from "../typography/Typography"; +import { Body, Headline } from "../typography/Typography"; import { Header, HeaderLogo, LeftNav, RightNav } from "../Header"; import { PosthogAnalytics } from "../analytics/PosthogAnalytics"; import { FieldRow, InputField } from "../input/Input"; import { StarRatingInput } from "../input/StarRatingInput"; import { RageshakeButton } from "../settings/RageshakeButton"; +import { Link } from "../button/Link"; +import { LinkButton } from "../button"; interface Props { client: MatrixClient; @@ -95,12 +97,7 @@ export const CallEndedView: FC = ({ calls

    - + {t("call_ended_view.create_account_button")} @@ -136,8 +133,6 @@ export const CallEndedView: FC = ({
    @@ -169,9 +164,7 @@ export const CallEndedView: FC = ({ {!confineToRoom && ( - - {t("return_home_button")} - + {t("return_home_button")} )} @@ -198,9 +191,7 @@ export const CallEndedView: FC = ({ {!confineToRoom && ( - - {t("call_ended_view.not_now_button")} - + {t("call_ended_view.not_now_button")} )} diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 22b6be8c..ebda4271 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -19,7 +19,6 @@ import { RoomContext, useLocalParticipant, } from "@livekit/components-react"; -import { usePreventScroll } from "@react-aria/overlays"; import { ConnectionState, Room } from "livekit-client"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { @@ -44,10 +43,10 @@ import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; import type { IWidgetApiRequest } from "matrix-widget-api"; import { - HangupButton, + EndCallButton, MicButton, VideoButton, - ScreenshareButton, + ShareScreenButton, SettingsButton, } from "../button"; import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header"; @@ -175,7 +174,6 @@ export const InCallView: FC = ({ connState, onShareClick, }) => { - usePreventScroll(); useWakeLock(); useEffect(() => { @@ -492,14 +490,14 @@ export const InCallView: FC = ({ , , @@ -507,21 +505,21 @@ export const InCallView: FC = ({ if (!reducedControls) { if (canScreenshare && !hideScreensharing) { buttons.push( - , ); } - buttons.push(); + buttons.push(); } buttons.push( - = ({ const recentsButtonInFooter = useMediaQuery("(max-height: 500px)"); const recentsButton = !confineToRoom && ( - + {t("lobby.leave_button")} ); @@ -140,16 +141,16 @@ export const LobbyView: FC = ({
    - - {!confineToRoom && } + + {!confineToRoom && }
    diff --git a/src/room/RageshakeRequestModal.tsx b/src/room/RageshakeRequestModal.tsx index 5d3280e0..4dcbb81d 100644 --- a/src/room/RageshakeRequestModal.tsx +++ b/src/room/RageshakeRequestModal.tsx @@ -16,9 +16,9 @@ limitations under the License. import { FC, useEffect } from "react"; import { useTranslation } from "react-i18next"; +import { Button } from "@vector-im/compound-web"; import { Modal, Props as ModalProps } from "../Modal"; -import { Button } from "../button"; import { FieldRow, ErrorMessage } from "../input/Input"; import { useSubmitRageshake } from "../settings/submit-rageshake"; import { Body } from "../typography/Typography"; @@ -52,7 +52,7 @@ export const RageshakeRequestModal: FC = ({ {t("rageshake_request_modal.body")} + ); }; test("spacebar unmutes", async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ document: window.document }); let muted = true; - render( (muted = m)} />); + render( + (muted = false)} + setMicrophoneMuted={(m) => { + muted = m; + }} + />, + ); await user.keyboard("[Space>]"); expect(muted).toBe(false); await user.keyboard("[/Space]"); + expect(muted).toBe(true); }); test("spacebar prioritizes pressing a button", async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ document: window.document }); + const setMuted = vi.fn(); const onClick = vi.fn(); render( @@ -71,7 +86,7 @@ test("spacebar prioritizes pressing a button", async () => { }); test("unmuting happens in place of the default action", async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ document: window.document }); const defaultPrevented = vi.fn(); // In the real application, we mostly just want the spacebar shortcut to avoid // scrolling the page. But to test that here in JSDOM, we need some kind of diff --git a/src/vitest.setup.ts b/src/vitest.setup.ts index a97fc335..e4210b7c 100644 --- a/src/vitest.setup.ts +++ b/src/vitest.setup.ts @@ -13,13 +13,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - import "global-jsdom/register"; - +import globalJsdom from "global-jsdom"; import i18n from "i18next"; import posthog from "posthog-js"; import { initReactI18next } from "react-i18next"; -import { afterEach } from "vitest"; +import { afterEach, beforeEach } from "vitest"; import { cleanup } from "@testing-library/react"; import { Config } from "./config/Config"; @@ -36,4 +35,12 @@ i18n.use(initReactI18next).init({ Config.initDefault(); posthog.opt_out_capturing(); -afterEach(cleanup); +// We need to cleanup the global jsDom +// Otherwise we will run into issues with async input test overlapping and throwing. + +let cleanupJsDom: { (): void }; +beforeEach(() => (cleanupJsDom = globalJsdom())); +afterEach(() => { + cleanupJsDom(); + cleanup(); +}); diff --git a/yarn.lock b/yarn.lock index e5174787..9d81ef44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2854,6 +2854,15 @@ resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA== +"@types/jsdom@^21.1.7": + version "21.1.7" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-21.1.7.tgz#9edcb09e0b07ce876e7833922d3274149c898cfa" + integrity sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -2869,6 +2878,13 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== +"@types/node@*": + version "22.5.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.1.tgz#de01dce265f6b99ed32b295962045d10b5b99560" + integrity sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw== + dependencies: + undici-types "~6.19.2" + "@types/node@>=13.7.0": version "22.1.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.1.0.tgz#6d6adc648b5e03f0e83c78dc788c2b037d0ad94b" @@ -2940,6 +2956,11 @@ resolved "https://registry.yarnpkg.com/@types/symlink-or-copy/-/symlink-or-copy-1.2.2.tgz#51b1c00b516a5774ada5d611e65eb123f988ef8d" integrity sha512-MQ1AnmTLOncwEf9IVU+B2e4Hchrku5N67NkgcAHW0p3sdzPe0FNMANxEm6OJUzPniEQGkeT3OROLlCwZJLWFZA== +"@types/tough-cookie@*": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + "@types/uuid@10": version "10.0.0" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d"