From c91defe2ed77e9972c8ac7da3c4c2580f6674006 Mon Sep 17 00:00:00 2001 From: Anton Arnautov Date: Sat, 7 Dec 2024 18:13:03 +0100 Subject: [PATCH 1/3] Update ESLint, migrate configuration file --- .eslintignore | 22 - .eslintrc.json | 230 -- e2e/fixtures/data/attachment.mjs | 2 +- eslint.config.mjs | 127 + examples/nextjs/pages/{_app.js => _app.jsx} | 0 examples/nextjs/pages/{index.js => index.jsx} | 0 package.json | 47 +- .../Attachment/__tests__/Attachment.test.js | 2 +- .../__tests__/AttachmentActions.test.js | 2 +- .../AutoCompleteTextarea/Textarea.jsx | 2 +- src/components/AutoCompleteTextarea/utils.js | 2 +- .../Avatar/__tests__/Avatar.test.js | 2 +- src/components/Channel/Channel.tsx | 8 +- .../__tests__/ChannelHeader.test.js | 2 +- src/components/ChannelList/ChannelList.tsx | 2 +- .../ChannelList/__tests__/ChannelList.test.js | 4 +- .../__tests__/ChannelPreview.test.js | 2 +- .../__tests__/ChannelPreviewMessenger.test.js | 2 +- .../ChannelSearch/__tests__/SearchBar.test.js | 2 +- .../ChannelSearch/hooks/useChannelSearch.ts | 6 +- .../__tests__/ChatAutocomplete.test.js | 2 +- src/components/ChatView/ChatView.tsx | 14 +- .../CommandItem/__tests__/CommandItem.test.js | 2 +- .../__tests__/DateSeparator.test.js | 2 +- .../__tests__/EmoticonItem.test.js | 2 +- .../__tests__/EmptyStateIndicator.test.js | 2 +- .../Gallery/__tests__/Image.test.js | 4 +- .../__tests__/InfiniteScroll.test.js | 2 +- .../Loading/__tests__/LoadingChannels.test.js | 2 +- .../__tests__/LoadingErrorIndicator.test.js | 2 +- .../__tests__/LoadingIndicator.test.js | 2 +- src/components/MML/MML.tsx | 1 + src/components/MML/__tests__/MML.test.js | 2 +- .../__tests__/AudioRecorder.test.js | 10 +- .../__tests__/AmplitudeRecorder.test.js | 2 +- .../__tests__/MediaRecorderController.test.js | 8 +- src/components/Message/FixedHeightMessage.tsx | 4 +- src/components/Message/Message.tsx | 12 +- .../Message/__tests__/Message.test.js | 2 +- .../Message/__tests__/MessageDeleted.test.js | 2 +- .../Message/__tests__/MessageOptions.test.js | 6 +- .../Message/__tests__/MessageSimple.test.js | 6 +- .../Message/__tests__/MessageText.test.js | 6 +- .../Message/hooks/useReactionHandler.ts | 4 +- .../Message/renderText/renderText.tsx | 1 - src/components/Message/utils.tsx | 28 +- .../__tests__/MessageActionsBox.test.js | 4 +- .../MessageInput/AttachmentSelector.tsx | 1 - .../__tests__/AttachmentPreviewList.test.js | 2 +- .../__tests__/LinkPreviewList.test.js | 34 +- .../__tests__/MessageInput.test.js | 8 +- .../MessageInput/hooks/useLinkPreviews.ts | 2 +- .../MessageInput/hooks/useSubmitHandler.ts | 2 +- .../MessageInput/hooks/useUserTrigger.ts | 4 +- src/components/MessageInput/hooks/utils.ts | 1 + src/components/MessageList/MessageList.tsx | 6 +- .../__tests__/CustomNotification.test.js | 4 +- .../MessageList/__tests__/MessageList.test.js | 2 +- .../__tests__/MessageNotification.test.js | 2 +- .../__tests__/ScrollToBottomButton.test.js | 2 +- src/components/MessageList/utils.ts | 3 +- src/components/Modal/__tests__/Modal.test.js | 2 +- .../Poll/__tests__/PollCreationDialog.test.js | 8 +- .../Reactions/__tests__/ReactionsList.test.js | 2 +- src/components/Reactions/reactionOptions.tsx | 2 +- src/components/Thread/Thread.tsx | 2 +- src/components/Threads/icons.tsx | 2 +- .../UserItem/__tests__/UserItem.test.js | 2 +- src/context/ComponentContext.tsx | 2 +- src/context/MessageContext.tsx | 2 +- .../MessageActions/MessageActions.tsx | 3 +- src/i18n/__tests__/Streami18n.test.js | 9 +- src/mock-builders/generator/attachment.js | 2 +- src/mock-builders/generator/channel.js | 4 +- src/mock-builders/index.js | 2 +- src/mock-builders/utils.js | 2 +- src/plugins/Emojis/EmojiPicker.tsx | 1 - src/stories/add-message.stories.tsx | 2 +- src/stories/hello.stories.tsx | 2 +- src/stories/jump-to-message.stories.tsx | 2 +- src/stories/mark-read.stories.tsx | 2 +- .../message-status-readby-tooltip.stories.tsx | 2 +- src/types/types.ts | 7 +- yarn.lock | 2180 +++++++++-------- 84 files changed, 1497 insertions(+), 1420 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs rename examples/nextjs/pages/{_app.js => _app.jsx} (100%) rename examples/nextjs/pages/{index.js => index.jsx} (100%) diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index ad50ecb1ac..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,22 +0,0 @@ -node_modules -build -src/stream-emoji.json -/.cache/ -/public/static/styles.js -examples/*/src/serviceWorker.js -scripts/ -/dist/ -/lib/ -/bin/ -/include/ -/build/ -dist -*dist* -/src/styles/vendor/ -*.md -babel.i18next-extract.js -/coverage -types/index.d.ts -src/components/Channel/types.ts -src/@types/* -docusaurus/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index f491712911..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "root": true, - "plugins": [ - "babel", - "jest-dom", - "jest", - "prettier", - "react-hooks", - "import", - "sort-destructure-keys" - ], - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:prettier/recommended", - "plugin:jest/all", - "plugin:jest-dom/recommended" - ], - // Next.js example comes with its own ESLint setup - "ignorePatterns": "examples/nextjs", - "rules": { - "array-callback-return": 2, - "arrow-body-style": 2, - "comma-dangle": 0, - "babel/no-invalid-this": 2, - "default-case": 2, - "eqeqeq": [2, "smart"], - "jest/expect-expect": 0, - "jest/no-conditional-expect": 0, - "jsx-quotes": ["error", "prefer-single"], - "linebreak-style": [2, "unix"], - "no-console": 0, - "no-mixed-spaces-and-tabs": 1, - "no-self-compare": 2, - "no-underscore-dangle": [2, { "allowAfterThis": true }], - "no-unused-vars": [1, { "ignoreRestSiblings": true }], - "no-use-before-define": 0, // can throw incorrect errors due to mismatch of @typescript-eslint versions in react-scripts and local package.json - "@typescript-eslint/no-use-before-define": 0, - "no-useless-concat": 2, - "no-var": 2, - "object-shorthand": 1, - "prefer-const": 1, - "react/jsx-sort-props": [ - "error", - { - "callbacksLast": false, - "ignoreCase": true, - "noSortAlphabetically": false, - "reservedFirst": false, - "shorthandFirst": false, - "shorthandLast": false - } - ], - "react/prop-types": 0, - "require-await": 2, - "semi": [1, "always"], - "sort-destructure-keys/sort-destructure-keys": [2, { "caseSensitive": false }], - "sort-imports": [ - "error", - { - "allowSeparatedGroups": true, - "ignoreCase": true, - "ignoreDeclarationSort": true, - "ignoreMemberSort": false, - "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] - } - ], - "sort-keys": ["error", "asc", { "caseSensitive": false, "minKeys": 2, "natural": false }], - "valid-typeof": 2, - "import/prefer-default-export": 0, - "import/extensions": [0], - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": true, // TODO: set to false once React is in the dependencies (not devDependencies) - "optionalDependencies": false, - "peerDependencies": false - } - ], - "max-classes-per-file": 0, - "camelcase": 0, - "react-hooks/rules-of-hooks": 1, - "react-hooks/exhaustive-deps": 1, - "jest/prefer-inline-snapshots": 0, - "jest/lowercase-name": 0, - "jest/prefer-expect-assertions": 0, - "jest/no-hooks": 0, - "no-unused-expressions": "off", - "babel/no-unused-expressions": "error", - "jest/no-if": "off" - }, - "env": { - "es6": true, - "browser": true - }, - "parser": "babel-eslint", - "parserOptions": { - // "allowImportExportEverywhere": true, - "sourceType": "module", - "ecmaVersion": 2018, - "ecmaFeatures": { - "modules": true - } - }, - "settings": { - "react": { - "pragma": "React", - "version": "detect" - }, - "import/resolver": { - "alias": { - "map": [["mock-builders", "./src/mock-builders"]], - "extensions": [".js", ".jsx", ".ts", ".tsx"] - }, - "eslint-import-resolver-babel-module": {}, - "node": { - "extensions": [".js", ".jsx", ".ts", ".tsx"], - "paths": ["src"] - } - } - }, - "overrides": [ - { - "files": ["*.md"], - "rules": { - "react/jsx-no-undef": 0, - "react/react-in-jsx-scope": 0, - "semi": 0, - "no-undef": 0 - } - }, - { - "env": { - "es6": true, - "browser": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:jest/recommended", - "plugin:prettier/recommended", - "plugin:react/recommended", - "prettier/@typescript-eslint" - ], - "files": ["**/*.ts", "**/*.tsx"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { - "modules": true, - "jsx": true - }, - "ecmaVersion": 2018, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "babel", - "prettier", - "react", - "typescript-sort-keys", - "sort-destructure-keys" - ], - "rules": { - "@typescript-eslint/explicit-module-boundary-types": 0, - "@typescript-eslint/no-empty-interface": 0, - "@typescript-eslint/ban-ts-comment": 0, - "@typescript-eslint/no-unused-vars": [1, { "ignoreRestSiblings": true }], - "@typescript-eslint/no-var-requires": 0, - "react-hooks/exhaustive-deps": 1, - "react-native/no-inline-styles": 0, - "array-callback-return": 2, - "arrow-body-style": 2, - "comma-dangle": 0, - "babel/no-invalid-this": 0, - "@typescript-eslint/no-invalid-this": 2, - "default-case": 2, - "eqeqeq": [2, "smart"], - "linebreak-style": [2, "unix"], - "jsx-quotes": ["error", "prefer-single"], - "no-console": 0, - "no-mixed-spaces-and-tabs": 1, - "no-self-compare": 2, - "no-shadow": 0, - "no-underscore-dangle": [2, { "allowAfterThis": true }], - "no-unused-vars": [1, { "ignoreRestSiblings": true }], - "no-useless-concat": 2, - "no-var": 2, - "object-shorthand": 1, - "prefer-const": 1, - "react/jsx-sort-props": [ - "error", - { - "callbacksLast": false, - "ignoreCase": true, - "noSortAlphabetically": false, - "reservedFirst": false, - "shorthandFirst": false, - "shorthandLast": false - } - ], - "react/prop-types": 0, - "require-await": 2, - "semi": [1, "always"], - "sort-destructure-keys/sort-destructure-keys": [2, { "caseSensitive": false }], - "sort-imports": [ - "error", - { - "allowSeparatedGroups": true, - "ignoreCase": true, - "ignoreDeclarationSort": true, - "ignoreMemberSort": false, - "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] - } - ], - "sort-keys": ["error", "asc", { "caseSensitive": false, "minKeys": 2, "natural": false }], - "typescript-sort-keys/interface": [ - "error", - "asc", - { "caseSensitive": false, "natural": true, "requiredFirst": true } - ], - "typescript-sort-keys/string-enum": [ - "error", - "asc", - { "caseSensitive": false, "natural": true } - ], - "valid-typeof": 2 - } - } - ] -} diff --git a/e2e/fixtures/data/attachment.mjs b/e2e/fixtures/data/attachment.mjs index 5e468d85f7..f89dbaa540 100644 --- a/e2e/fixtures/data/attachment.mjs +++ b/e2e/fixtures/data/attachment.mjs @@ -1,4 +1,4 @@ -/* eslint-disable sort-keys */ + const smallImageAttachment = [ { type: 'image', diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..8bfe8f6087 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,127 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +import reactHooksPlugin from 'eslint-plugin-react-hooks'; +import reactPlugin from 'eslint-plugin-react'; +import importPlugin from 'eslint-plugin-import'; +import jestPlugin from 'eslint-plugin-jest'; +import jestDOMPlugin from 'eslint-plugin-jest-dom'; + +export default tseslint.config( + { + ignores: ['dist', 'src/@types', '*.{js,ts}'], + }, + { + name: 'default', + extends: [ + js.configs.recommended, + ...tseslint.configs.recommended, + reactPlugin.configs.flat.recommended, + ], + files: ['src/**/*.{js,ts,jsx,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooksPlugin, + import: importPlugin, + }, + settings: { + react: { + version: 'detect', + }, + }, + rules: { + camelcase: 'off', + semi: ['warn', 'always'], + eqeqeq: ['error', 'smart'], + 'array-callback-return': 'error', + 'arrow-body-style': 'error', + 'comma-dangle': 'off', + 'default-case': 'error', + 'jsx-quotes': ['error', 'prefer-single'], + 'linebreak-style': ['error', 'unix'], + 'no-console': 'off', + 'no-mixed-spaces-and-tabs': 'warn', + 'no-self-compare': 'error', + 'no-underscore-dangle': ['error', { allowAfterThis: true }], + 'no-use-before-define': 'off', + 'no-useless-concat': 'error', + 'no-var': 'error', + 'object-shorthand': 'warn', + 'prefer-const': 'warn', + 'require-await': 'error', + // TODO: find appropriate plugin for this rule + // "sort-destructure-keys/sort-destructure-keys": [ + // "error", + // { caseSensitive: false }, + // ], + 'sort-imports': [ + 'error', + { + allowSeparatedGroups: true, + ignoreCase: true, + ignoreDeclarationSort: true, + ignoreMemberSort: false, + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], + }, + ], + 'sort-keys': ['error', 'asc', { caseSensitive: false, minKeys: 2, natural: false }], + 'valid-typeof': 'error', + 'max-classes-per-file': 'off', + 'no-unused-expressions': 'off', + 'no-unused-vars': 'off', + 'import/prefer-default-export': 'off', + 'import/extensions': 'off', + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, // TODO: set to false once React is in the dependencies (not devDependencies) + optionalDependencies: false, + peerDependencies: false, + }, + ], + '@typescript-eslint/no-unused-vars': [ + 'warn', + { ignoreRestSiblings: true, caughtErrors: 'none' }, + ], + '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/no-require-imports': 'off', // TODO: remove this rule once all files are .mjs (and require is not used) + 'react/prop-types': 'off', + 'react/react-in-jsx-scope': 'off', + 'react/jsx-sort-props': [ + 'error', + { + callbacksLast: false, + ignoreCase: true, + noSortAlphabetically: false, + reservedFirst: false, + shorthandFirst: false, + shorthandLast: false, + }, + ], + 'react-hooks/rules-of-hooks': 'warn', + 'react-hooks/exhaustive-deps': 'error', + }, + }, + { + name: 'jest', + files: ['src/**/__tests__/**'], + plugins: { jest: jestPlugin, 'jest-dom': jestDOMPlugin }, + languageOptions: { + globals: jestPlugin.environments.globals.globals, + }, + rules: { + 'jest/expect-expect': 'off', + 'jest/no-conditional-expect': 'off', + 'jest/prefer-inline-snapshots': 'off', + 'jest/lowercase-name': 'off', + 'jest/prefer-expect-assertions': 'off', + 'jest/no-hooks': 'off', + 'jest/no-if': 'off', + 'jest-dom/prefer-in-document': 'error', + }, + }, +); diff --git a/examples/nextjs/pages/_app.js b/examples/nextjs/pages/_app.jsx similarity index 100% rename from examples/nextjs/pages/_app.js rename to examples/nextjs/pages/_app.jsx diff --git a/examples/nextjs/pages/index.js b/examples/nextjs/pages/index.jsx similarity index 100% rename from examples/nextjs/pages/index.js rename to examples/nextjs/pages/index.jsx diff --git a/package.json b/package.json index 0ae609b7b6..805b77b785 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "clsx": "^2.0.0", "dayjs": "^1.10.4", "emoji-regex": "^9.2.0", + "eslint-plugin-jest": "^28.9.0", "fix-webm-duration": "^1.0.5", "hast-util-find-and-replace": "^5.0.1", "i18next": "^21.6.14", @@ -181,6 +182,7 @@ "@commitlint/config-conventional": "^18.4.3", "@emoji-mart/data": "^1.1.2", "@emoji-mart/react": "^1.1.1", + "@eslint/js": "^9.16.0", "@ladle/react": "^0.16.0", "@playwright/test": "^1.42.1", "@semantic-release/changelog": "^6.0.2", @@ -208,10 +210,7 @@ "@types/react-is": "^18.2.4", "@types/textarea-caret": "3.0.0", "@types/uuid": "^8.3.0", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", "autoprefixer": "^10.0.3", - "babel-eslint": "^10.1.0", "babel-jest": "^28.1.3", "babel-plugin-module-resolver": "^4.1.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", @@ -223,27 +222,12 @@ "emoji-mart": "^5.5.2", "esbuild": "^0.23.1", "esbuild-plugin-replace": "^1.4.0", - "eslint": "7.14.0", - "eslint-config-airbnb": "^18.2.1", - "eslint-config-prettier": "^6.15.0", - "eslint-config-react-app": "^6.0.0", - "eslint-import-resolver-alias": "^1.1.2", - "eslint-import-resolver-babel-module": "^5.2.0", - "eslint-plugin-babel": "^5.3.1", - "eslint-plugin-flowtype": "^5.2.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jest": "^24.1.3", - "eslint-plugin-jest-dom": "^3.3.0", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-react": "^7.21.5", - "eslint-plugin-react-hooks": "^4.2.0", - "eslint-plugin-sort-destructure-keys": "1.3.5", - "eslint-plugin-sort-keys-fix": "^1.1.2", - "eslint-plugin-testing-library": "^6.2.0", - "eslint-plugin-typescript-sort-keys": "^2.1.0", + "eslint": "^9.16.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest-dom": "^5.5.0", + "eslint-plugin-react": "^7.37.2", + "eslint-plugin-react-hooks": "^5.1.0", + "globals": "^15.13.0", "husky": "^8.0.3", "i18next-parser": "^6.0.0", "jest": "^29.7.0", @@ -252,25 +236,26 @@ "jsdom": "^24.1.1", "lint-staged": "^15.2.1", "moment-timezone": "^0.5.43", - "prettier": "^2.2.0", + "prettier": "^3.4.2", "react": "^18.1.0", "react-dom": "^18.1.0", "react-test-renderer": "^18.1.0", "semantic-release": "^19.0.5", "stream-chat": "^8.46.0", "ts-jest": "^29.1.4", - "typescript": "^5.4.5" + "typescript": "^5.4.5", + "typescript-eslint": "^8.17.0" }, "scripts": { "build": "rm -rf dist && yarn build-translations && yarn bundle", "bundle": "concurrently ./scripts/bundle-esm.mjs ./scripts/copy-css.sh scripts/bundle-cjs.mjs", "build-translations": "i18next", "coverage": "jest --collectCoverage && codecov", - "eslint": "eslint '**/*.{js,md,ts,jsx,tsx}' --max-warnings 0", - "lint": "prettier --list-different 'src/**/*.{js,ts,tsx,md,json}' .eslintrc.json .prettierrc babel.config.js && eslint 'src/**/*.{js,ts,tsx,md}' --max-warnings 0 && yarn validate-translations", - "lint-fix": "prettier --write 'src/**/*.{js,ts,tsx,md,json}' .eslintrc.json .prettierrc babel.config.js && eslint --fix 'src/**/*.{js,ts,tsx,md}' --max-warnings 0", - "prettier": "prettier --list-different '**/*.{js,ts,tsx,md,json}' .eslintrc.json .prettierrc babel.config.js", - "prettier-fix": "prettier --write '**/*.{js,ts,tsx,md,json}' .eslintrc.json .prettierrc babel.config.js", + "eslint": "eslint --max-warnings 0", + "lint": "prettier --list-different 'src/**/*.{js,ts,tsx,md,json}' .prettierrc babel.config.js && yarn eslint && yarn validate-translations", + "lint-fix": "prettier --write 'src/**/*.{js,ts,tsx,md,json}' .prettierrc babel.config.js && yarn eslint --fix", + "prettier": "prettier --list-different '**/*.{js,ts,tsx,md,json}' .prettierrc babel.config.js", + "prettier-fix": "prettier --write '**/*.{js,ts,tsx,md,json}' .prettierrc babel.config.js", "fix-staged": "lint-staged --config .lintstagedrc.fix.json --concurrent 1", "start": "tsc --watch --sourceMap --declarationMap", "prepare": "husky install", diff --git a/src/components/Attachment/__tests__/Attachment.test.js b/src/components/Attachment/__tests__/Attachment.test.js index ee24ee0148..24dcb6ceec 100644 --- a/src/components/Attachment/__tests__/Attachment.test.js +++ b/src/components/Attachment/__tests__/Attachment.test.js @@ -213,7 +213,7 @@ describe('attachment', () => { ], }); await waitFor(() => { - /* eslint-disable jest-dom/prefer-in-document */ + const Card = queryAllByTestId('card-attachment'); expect(Card).toHaveLength(3); diff --git a/src/components/Attachment/__tests__/AttachmentActions.test.js b/src/components/Attachment/__tests__/AttachmentActions.test.js index b864614afe..f7a514de43 100644 --- a/src/components/Attachment/__tests__/AttachmentActions.test.js +++ b/src/components/Attachment/__tests__/AttachmentActions.test.js @@ -51,7 +51,7 @@ describe('AttachmentActions', () => { fireEvent.click(getByTestId(actions[1].name)); await waitFor(() => { - // eslint-disable-next-line jest/prefer-called-with + expect(actionHandler).toHaveBeenCalledTimes(2); }); }); diff --git a/src/components/AutoCompleteTextarea/Textarea.jsx b/src/components/AutoCompleteTextarea/Textarea.jsx index 899c72676c..43391ead3a 100644 --- a/src/components/AutoCompleteTextarea/Textarea.jsx +++ b/src/components/AutoCompleteTextarea/Textarea.jsx @@ -455,7 +455,7 @@ export class ReactTextareaAutocomplete extends React.Component { 'value', ]; - // eslint-disable-next-line + for (const prop in props) { if (notSafe.includes(prop)) delete props[prop]; } diff --git a/src/components/AutoCompleteTextarea/utils.js b/src/components/AutoCompleteTextarea/utils.js index 52314ec964..e1f37172a6 100644 --- a/src/components/AutoCompleteTextarea/utils.js +++ b/src/components/AutoCompleteTextarea/utils.js @@ -17,7 +17,7 @@ export function defaultScrollToItem(container, item) { return; } - // eslint-disable-next-line + container.scrollTop = itemOffsetTop; } diff --git a/src/components/Avatar/__tests__/Avatar.test.js b/src/components/Avatar/__tests__/Avatar.test.js index b45990d7c0..3f362bb26f 100644 --- a/src/components/Avatar/__tests__/Avatar.test.js +++ b/src/components/Avatar/__tests__/Avatar.test.js @@ -9,7 +9,7 @@ const AVATAR_ROOT_TEST_ID = 'avatar'; const AVATAR_FALLBACK_TEST_ID = 'avatar-fallback'; const AVATAR_IMG_TEST_ID = 'avatar-img'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('Avatar', () => { it('should render component with default props', () => { diff --git a/src/components/Channel/Channel.tsx b/src/components/Channel/Channel.tsx index e468e79b8e..15512829a0 100644 --- a/src/components/Channel/Channel.tsx +++ b/src/components/Channel/Channel.tsx @@ -586,7 +586,7 @@ const ChannelInner = < }); if (client.user?.id && channel.state.read[client.user.id]) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { user, ...ownReadState } = channel.state.read[client.user.id]; _setChannelUnreadUiState(ownReadState); } @@ -1008,7 +1008,7 @@ const ChannelInner = < }); thread?.upsertReplyLocally({ - // @ts-expect-error + // @ts-expect-error message type mismatch message: { ...message, error: parsedError, @@ -1047,7 +1047,7 @@ const ChannelInner = < }; thread?.upsertReplyLocally({ - // @ts-expect-error + // @ts-expect-error message type mismatch message: messagePreview, }); @@ -1224,7 +1224,7 @@ const ChannelInner = < ], ); - // @ts-expect-error + // @ts-expect-error generics are missing (not needed here) const componentContextValue: Partial = useMemo( () => ({ Attachment: props.Attachment, diff --git a/src/components/ChannelHeader/__tests__/ChannelHeader.test.js b/src/components/ChannelHeader/__tests__/ChannelHeader.test.js index b6d10b7496..d91c2dd4e4 100644 --- a/src/components/ChannelHeader/__tests__/ChannelHeader.test.js +++ b/src/components/ChannelHeader/__tests__/ChannelHeader.test.js @@ -59,7 +59,7 @@ async function renderComponent(props, channelData, channelType = 'messaging') { return renderComponentBase({ channel, client, props }); } -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('ChannelHeader', () => { it('should display live label when prop live is true', async () => { diff --git a/src/components/ChannelList/ChannelList.tsx b/src/components/ChannelList/ChannelList.tsx index 73fd8564e7..8d154a580a 100644 --- a/src/components/ChannelList/ChannelList.tsx +++ b/src/components/ChannelList/ChannelList.tsx @@ -232,7 +232,7 @@ const UnMemoizedChannelList = < let customActiveChannelObject = channels.find((chan) => chan.id === customActiveChannel); if (!customActiveChannelObject) { - //@ts-expect-error + //@ts-expect-error this is a valid query [customActiveChannelObject] = await client.queryChannels({ id: customActiveChannel }); } diff --git a/src/components/ChannelList/__tests__/ChannelList.test.js b/src/components/ChannelList/__tests__/ChannelList.test.js index a9aeab0743..d2e320ccb4 100644 --- a/src/components/ChannelList/__tests__/ChannelList.test.js +++ b/src/components/ChannelList/__tests__/ChannelList.test.js @@ -294,7 +294,7 @@ describe('ChannelList', () => { // Wait for list of channels to load in DOM. await waitFor(() => { expect(getByRole('list')).toBeInTheDocument(); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(queryAllByRole('listitem')).toHaveLength(1); }); const results = await axe(container); @@ -620,7 +620,7 @@ describe('ChannelList', () => { let channel; beforeEach(async () => { client = await getTestClientWithUser({ id: user1.id }); - // eslint-disable-next-line react-hooks/rules-of-hooks + useMockedApis(client, [getOrCreateChannelApi(mockedChannels[0])]); channel = client.channel('messaging', mockedChannels[0].id); await channel.watch(); diff --git a/src/components/ChannelPreview/__tests__/ChannelPreview.test.js b/src/components/ChannelPreview/__tests__/ChannelPreview.test.js index 035ac4bb5b..41cd5a7465 100644 --- a/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +++ b/src/components/ChannelPreview/__tests__/ChannelPreview.test.js @@ -98,7 +98,7 @@ describe('ChannelPreview', () => { [c0, c1] = await client.queryChannels({}, {}); }); - // eslint-disable-next-line jest/expect-expect + it('should mark channel as read, when set as active channel', async () => { // Mock the countUnread function on channel, to return 10. c0.countUnread = () => 10; diff --git a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js index 56b26c7d4f..748f29ef5d 100644 --- a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +++ b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js @@ -74,7 +74,7 @@ describe('ChannelPreviewMessenger', () => { fireEvent.click(getByTestId(PREVIEW_TEST_ID)); await waitFor(() => { - // eslint-disable-next-line jest/prefer-called-with + expect(setActiveChannel).toHaveBeenCalledTimes(1); expect(setActiveChannel).toHaveBeenCalledWith(channel, {}); }); diff --git a/src/components/ChannelSearch/__tests__/SearchBar.test.js b/src/components/ChannelSearch/__tests__/SearchBar.test.js index 0f5f8f5ac6..8ccf9c8eab 100644 --- a/src/components/ChannelSearch/__tests__/SearchBar.test.js +++ b/src/components/ChannelSearch/__tests__/SearchBar.test.js @@ -43,7 +43,7 @@ describe('SearchBar', () => { beforeEach(async () => { const user = generateUser(); client = await getTestClientWithUser({ id: user.id }); - useMockedApis(client, [queryUsersApi([user])]); // eslint-disable-line react-hooks/rules-of-hooks + useMockedApis(client, [queryUsersApi([user])]); }); it.each([ diff --git a/src/components/ChannelSearch/hooks/useChannelSearch.ts b/src/components/ChannelSearch/hooks/useChannelSearch.ts index f48da6ab5a..72952f6b1b 100644 --- a/src/components/ChannelSearch/hooks/useChannelSearch.ts +++ b/src/components/ChannelSearch/hooks/useChannelSearch.ts @@ -156,7 +156,7 @@ export const useChannelSearch = < document.addEventListener('click', clickListener); return () => document.removeEventListener('click', clickListener); - // eslint-disable-next-line react-hooks/exhaustive-deps + }, [disabled, inputIsFocused, query, exitSearch, clearSearchOnClickOutside]); useEffect(() => { @@ -213,7 +213,7 @@ export const useChannelSearch = < let results: ChannelOrUserResponse[] = []; try { const userQueryPromise = client.queryUsers( - // @ts-expect-error + // @ts-expect-error this is a valid query { $or: [{ id: { $autocomplete: text } }, { name: { $autocomplete: text } }], ...searchQueryParams?.userFilters?.filters, @@ -228,7 +228,7 @@ export const useChannelSearch = < results = users.filter((u) => u.id !== client.user?.id); } else { const channelQueryPromise = client.queryChannels( - // @ts-expect-error + // @ts-expect-error this is a valid query { name: { $autocomplete: text }, ...searchQueryParams?.channelFilters?.filters, diff --git a/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js b/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js index 62effbf3b9..67e0b0b9a2 100644 --- a/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js +++ b/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js @@ -214,7 +214,7 @@ describe('ChatAutoComplete', () => { typeText(userAutocompleteText); const userText = await queryAllByText(user.name); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(userText).toHaveLength(0); }); diff --git a/src/components/ChatView/ChatView.tsx b/src/components/ChatView/ChatView.tsx index 7ff684c675..4dfd2fd9a0 100644 --- a/src/components/ChatView/ChatView.tsx +++ b/src/components/ChatView/ChatView.tsx @@ -10,10 +10,10 @@ import type { PropsWithChildren } from 'react'; import type { Thread, ThreadManagerState } from 'stream-chat'; import clsx from 'clsx'; -const availableChatViews = ['channels', 'threads'] as const; +type AvailableChatViews = 'channels' | 'threads'; type ChatViewContextValue = { - activeChatView: typeof availableChatViews[number]; + activeChatView: AvailableChatViews; setActiveChatView: (cv: ChatViewContextValue['activeChatView']) => void; }; @@ -23,9 +23,8 @@ const ChatViewContext = createContext({ }); export const ChatView = ({ children }: PropsWithChildren) => { - const [activeChatView, setActiveChatView] = useState( - 'channels', - ); + const [activeChatView, setActiveChatView] = + useState('channels'); const { theme } = useChatContext(); @@ -60,9 +59,8 @@ export const useThreadsViewContext = () => useContext(ThreadsViewContext); const ThreadsView = ({ children }: PropsWithChildren) => { const { activeChatView } = useContext(ChatViewContext); - const [activeThread, setActiveThread] = useState( - undefined, - ); + const [activeThread, setActiveThread] = + useState(undefined); const value = useMemo(() => ({ activeThread, setActiveThread }), [activeThread]); diff --git a/src/components/CommandItem/__tests__/CommandItem.test.js b/src/components/CommandItem/__tests__/CommandItem.test.js index fceb833cb0..5afccb789b 100644 --- a/src/components/CommandItem/__tests__/CommandItem.test.js +++ b/src/components/CommandItem/__tests__/CommandItem.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { CommandItem } from '../CommandItem'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('commandItem', () => { it('should render component with empty entity', () => { diff --git a/src/components/DateSeparator/__tests__/DateSeparator.test.js b/src/components/DateSeparator/__tests__/DateSeparator.test.js index bcd549043e..87072858b9 100644 --- a/src/components/DateSeparator/__tests__/DateSeparator.test.js +++ b/src/components/DateSeparator/__tests__/DateSeparator.test.js @@ -12,7 +12,7 @@ import { Streami18n } from '../../../i18n'; Dayjs.extend(calendar); -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); const DATE_SEPARATOR_TEST_ID = 'date-separator'; const dateMock = 'the date'; diff --git a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js index 0ac8822c9f..8d036661e0 100644 --- a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js +++ b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { EmoticonItem } from '../EmoticonItem'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('EmoticonItem', () => { it('should render component with empty entity', () => { diff --git a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js index 4e2703f3d2..f0a5b88cd1 100644 --- a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js +++ b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { EmptyStateIndicator } from '../EmptyStateIndicator'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('EmptyStateIndicator', () => { it('should render with default props', () => { diff --git a/src/components/Gallery/__tests__/Image.test.js b/src/components/Gallery/__tests__/Image.test.js index 64c83b1780..a09561f0c4 100644 --- a/src/components/Gallery/__tests__/Image.test.js +++ b/src/components/Gallery/__tests__/Image.test.js @@ -31,7 +31,7 @@ describe('Image', () => { describe('it should prevent unsafe image uri protocols in the rendered image src', () => { it('should prevent javascript protocol in image src', () => { - // eslint-disable-next-line no-script-url + const xssJavascriptUri = 'javascript:alert("p0wn3d")'; const { getByTestId } = render( @@ -41,7 +41,7 @@ describe('Image', () => { expect(getByTestId('image-test')).not.toHaveAttribute('src', xssJavascriptUri); }); it('should prevent javascript protocol in thumbnail src', () => { - // eslint-disable-next-line no-script-url + const xssJavascriptUri = 'javascript:alert("p0wn3d")'; const { getByTestId } = render( diff --git a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js index 206768fd20..336a8fd9a0 100644 --- a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js +++ b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js @@ -105,7 +105,7 @@ describe('InfiniteScroll', () => { consoleWarnSpy.mockRestore(); expect(oldLoaderSpy).not.toHaveBeenCalled(); - // eslint-disable-next-line jest/prefer-called-with + expect(newLoaderSpy).toHaveBeenCalled(); }, ); diff --git a/src/components/Loading/__tests__/LoadingChannels.test.js b/src/components/Loading/__tests__/LoadingChannels.test.js index 5318a3c9d3..6617323567 100644 --- a/src/components/Loading/__tests__/LoadingChannels.test.js +++ b/src/components/Loading/__tests__/LoadingChannels.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { LoadingChannels } from '../LoadingChannels'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('LoadingChannels', () => { it('should render component with default props', () => { diff --git a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js index 946e087088..584c764088 100644 --- a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js @@ -9,7 +9,7 @@ import { Chat } from '../../Chat'; import { getTestClientWithUser } from '../../../mock-builders'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('LoadingErrorIndicator', () => { it('should return null if no error is provided', () => { diff --git a/src/components/Loading/__tests__/LoadingIndicator.test.js b/src/components/Loading/__tests__/LoadingIndicator.test.js index 1c87815be4..9e93184ae7 100644 --- a/src/components/Loading/__tests__/LoadingIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingIndicator.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { LoadingIndicator } from '../LoadingIndicator'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('LoadingIndicator', () => { it('should render with default props', () => { diff --git a/src/components/MML/MML.tsx b/src/components/MML/MML.tsx index 6d2c3c679c..76fd6c498a 100644 --- a/src/components/MML/MML.tsx +++ b/src/components/MML/MML.tsx @@ -5,6 +5,7 @@ import { useChatContext } from '../../context/ChatContext'; import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler'; const MMLReact = React.lazy(async () => { + // eslint-disable-next-line import/no-extraneous-dependencies const mml = await import('mml-react'); return { default: mml.MML }; }); diff --git a/src/components/MML/__tests__/MML.test.js b/src/components/MML/__tests__/MML.test.js index 932c36db55..947a079add 100644 --- a/src/components/MML/__tests__/MML.test.js +++ b/src/components/MML/__tests__/MML.test.js @@ -7,7 +7,7 @@ import { MML } from '../MML'; import { ChatProvider } from '../../../context/ChatContext'; import { MessageProvider } from '../../../context/MessageContext'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); const renderComponent = async ( { chatCtx = {}, messageCtx = {}, mmlProps }, diff --git a/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js b/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js index eb260da33f..7c9b56793d 100644 --- a/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js +++ b/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js @@ -116,19 +116,19 @@ window.navigator.permissions = { query: jest.fn(), }; -// eslint-disable-next-line + window.MediaRecorder = MediaRecorderMock; -// eslint-disable-next-line + window.AudioContext = AudioContextMock; -// eslint-disable-next-line + window.AnalyserNode = AnalyserNodeMock; const fileObjectURL = 'fileObjectURL'; -// eslint-disable-next-line + window.URL.createObjectURL = jest.fn(() => fileObjectURL); -// eslint-disable-next-line + window.URL.revokeObjectURL = jest.fn(); describe('MessageInput', () => { diff --git a/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js b/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js index 1cef13a0d4..be819af5c7 100644 --- a/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js +++ b/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js @@ -5,7 +5,7 @@ import { } from '../AmplitudeRecorder'; import { AudioContextMock } from '../../../../mock-builders/browser'; -// eslint-disable-next-line + window.AudioContext = AudioContextMock; const intervalID = 1; diff --git a/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js b/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js index ce89e15930..46969dd5ac 100644 --- a/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js +++ b/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js @@ -65,15 +65,15 @@ const expectRegistersError = async ({ action, controller, errorMsg, notification notificationSubscription?.unsubscribe(); }; -// eslint-disable-next-line + window.MediaRecorder = MediaRecorderMock; -// eslint-disable-next-line + window.AudioContext = AudioContextMock; -// eslint-disable-next-line + window.URL.createObjectURL = jest.fn(() => fileObjectURL); -// eslint-disable-next-line + window.URL.revokeObjectURL = jest.fn(); describe('MediaRecorderController', () => { diff --git a/src/components/Message/FixedHeightMessage.tsx b/src/components/Message/FixedHeightMessage.tsx index d72a8e9aaf..855c305e7e 100644 --- a/src/components/Message/FixedHeightMessage.tsx +++ b/src/components/Message/FixedHeightMessage.tsx @@ -29,8 +29,8 @@ const selectColor = (number: number, dark: boolean) => { const hashUserId = (userId: string) => { const hash = userId.split('').reduce((acc, c) => { - acc = (acc << 5) - acc + c.charCodeAt(0); // eslint-disable-line - return acc & acc; // eslint-disable-line no-bitwise + acc = (acc << 5) - acc + c.charCodeAt(0); + return acc & acc; }, 0); return Math.abs(hash) / 10 ** Math.ceil(Math.log10(Math.abs(hash) + 1)); }; diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx index 786c9046a0..171a6bae41 100644 --- a/src/components/Message/Message.tsx +++ b/src/components/Message/Message.tsx @@ -143,12 +143,12 @@ const MessageWithContext = < ); const { - canPin: canPinPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - messageActions: messageActionsPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - onlySenderCanEdit: onlySenderCanEditPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - onUserClick: onUserClickPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - onUserHover: onUserHoverPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - userRoles: userRolesPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars + canPin: canPinPropToNotPass, + messageActions: messageActionsPropToNotPass, + onlySenderCanEdit: onlySenderCanEditPropToNotPass, + onUserClick: onUserClickPropToNotPass, + onUserHover: onUserHoverPropToNotPass, + userRoles: userRolesPropToNotPass, ...rest } = props; diff --git a/src/components/Message/__tests__/Message.test.js b/src/components/Message/__tests__/Message.test.js index 67c2f90ad8..aeedc5644d 100644 --- a/src/components/Message/__tests__/Message.test.js +++ b/src/components/Message/__tests__/Message.test.js @@ -71,7 +71,7 @@ async function renderComponent({ > , ...components, }} diff --git a/src/components/Message/__tests__/MessageDeleted.test.js b/src/components/Message/__tests__/MessageDeleted.test.js index 710a4fbfbd..6ceb7bc724 100644 --- a/src/components/Message/__tests__/MessageDeleted.test.js +++ b/src/components/Message/__tests__/MessageDeleted.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ + import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; diff --git a/src/components/Message/__tests__/MessageOptions.test.js b/src/components/Message/__tests__/MessageOptions.test.js index b744bc2ad6..5587000e3b 100644 --- a/src/components/Message/__tests__/MessageOptions.test.js +++ b/src/components/Message/__tests__/MessageOptions.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ + import React from 'react'; import { act, fireEvent, render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -68,7 +68,7 @@ async function renderMessageOptions({ , reactionOptions: defaultReactionOptions, }} @@ -158,7 +158,7 @@ describe('', () => { }); expect(handleOpenThread).not.toHaveBeenCalled(); fireEvent.click(getByTestId(threadActionTestId)); - // eslint-disable-next-line jest/prefer-called-with + expect(handleOpenThread).toHaveBeenCalled(); }); diff --git a/src/components/Message/__tests__/MessageSimple.test.js b/src/components/Message/__tests__/MessageSimple.test.js index ab27b69df9..353aab9041 100644 --- a/src/components/Message/__tests__/MessageSimple.test.js +++ b/src/components/Message/__tests__/MessageSimple.test.js @@ -85,7 +85,7 @@ async function renderMessageSimple({ , reactionOptions: defaultReactionOptions, ...components, @@ -500,7 +500,7 @@ describe('', () => { handleOpenThread: jest.fn(), }, }); - // eslint-disable-next-line jest/prefer-called-with + expect(MessageOptionsMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -556,7 +556,7 @@ describe('', () => { unsafeHTML, }, }); - // eslint-disable-next-line jest/prefer-called-with + expect(MessageTextMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/Message/__tests__/MessageText.test.js b/src/components/Message/__tests__/MessageText.test.js index 4f561c2a9c..5bbb501946 100644 --- a/src/components/Message/__tests__/MessageText.test.js +++ b/src/components/Message/__tests__/MessageText.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ + import '@testing-library/jest-dom'; import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { toHaveNoViolations } from 'jest-axe'; @@ -84,7 +84,7 @@ async function renderMessageText({ , reactionOptions: defaultReactionOptions, }} @@ -281,7 +281,7 @@ describe('', () => { }, }, }); - // eslint-disable-next-line jest/prefer-called-with + expect(MessageOptionsMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/Message/hooks/useReactionHandler.ts b/src/components/Message/hooks/useReactionHandler.ts index 271421342f..c493d6e14a 100644 --- a/src/components/Message/hooks/useReactionHandler.ts +++ b/src/components/Message/hooks/useReactionHandler.ts @@ -94,7 +94,7 @@ export const useReactionHandler = < try { updateMessage(tempMessage); - // @ts-expect-error + // @ts-expect-error message type mismatch thread?.upsertReplyLocally({ message: tempMessage }); const messageResponse = add @@ -106,7 +106,7 @@ export const useReactionHandler = < } catch (error) { // revert to the original message if the API call fails updateMessage(message); - // @ts-expect-error + // @ts-expect-error message type mismatch thread?.upsertReplyLocally({ message }); } }, 1000); diff --git a/src/components/Message/renderText/renderText.tsx b/src/components/Message/renderText/renderText.tsx index 8e2e0ace53..e8859b5f2e 100644 --- a/src/components/Message/renderText/renderText.tsx +++ b/src/components/Message/renderText/renderText.tsx @@ -73,7 +73,6 @@ export const markDownRenderers: RenderTextOptions['customMarkDownRenderers'] = { export type RenderTextOptions< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics > = { - // eslint-disable-next-line @typescript-eslint/ban-types allowedTagNames?: Array; customMarkDownRenderers?: Options['components'] & Partial<{ diff --git a/src/components/Message/utils.tsx b/src/components/Message/utils.tsx index 2a01bb31f2..b1c1af2c95 100644 --- a/src/components/Message/utils.tsx +++ b/src/components/Message/utils.tsx @@ -23,10 +23,8 @@ export const validateAndGetMessage = ( ) => { if (!func || typeof func !== 'function') return null; - // below is due to tests passing a single argument - // rather than an array. if (!(args instanceof Array)) { - // @ts-expect-error + // @ts-expect-error below is due to tests passing a single argument rather than an array args = [args]; } @@ -41,7 +39,7 @@ export const validateAndGetMessage = ( * Tell if the owner of the current message is muted */ export const isUserMuted = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: StreamMessage, mutes?: Mute[], @@ -219,7 +217,7 @@ export const showMessageActionsBox = ( ) => shouldRenderMessageActions({ inThread, messageActions: actions }); export const shouldRenderMessageActions = < - SCG extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + SCG extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ customMessageActions, CustomMessageActionsList, @@ -266,7 +264,7 @@ export const shouldRenderMessageActions = < }; function areMessagesEqual< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( prevMessage: StreamMessage, nextMessage: StreamMessage, @@ -292,7 +290,7 @@ function areMessagesEqual< } export const areMessagePropsEqual = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( prevProps: MessageProps & { mutes?: Mute[]; @@ -336,7 +334,7 @@ export const areMessagePropsEqual = < }; export const areMessageUIPropsEqual = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( prevProps: MessageContextValue & { showDetailedReactions?: boolean; @@ -370,19 +368,19 @@ export const areMessageUIPropsEqual = < }; export const messageHasReactions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, ) => Object.values(message?.reaction_groups ?? {}).some(({ count }) => count > 0); export const messageHasAttachments = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, ) => !!message?.attachments && !!message.attachments.length; export const getImages = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: MessageResponse, ) => { @@ -393,7 +391,7 @@ export const getImages = < }; export const getNonImageAttachments = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: MessageResponse, ) => { @@ -417,7 +415,7 @@ export interface TooltipUsernameMapper { export const mapToUserNameOrId: TooltipUsernameMapper = (user) => user.name || user.id; export const getReadByTooltipText = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( users: UserResponse[], t: TFunction, @@ -483,7 +481,7 @@ export const isOnlyEmojis = (text?: string) => { }; export const isMessageBounced = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: Pick, 'type' | 'moderation' | 'moderation_details'>, ) => @@ -492,7 +490,7 @@ export const isMessageBounced = < message.moderation?.action === 'bounce'); export const isMessageEdited = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: Pick, 'message_text_updated_at'>, ) => !!message.message_text_updated_at; diff --git a/src/components/MessageActions/__tests__/MessageActionsBox.test.js b/src/components/MessageActions/__tests__/MessageActionsBox.test.js index 6a62a5383d..f4b57fff98 100644 --- a/src/components/MessageActions/__tests__/MessageActionsBox.test.js +++ b/src/components/MessageActions/__tests__/MessageActionsBox.test.js @@ -408,13 +408,13 @@ describe('MessageActionsBox', () => { }); await toggleOpenMessageActions(0); let boxes = screen.getAllByTestId('message-actions-box'); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(boxes).toHaveLength(1); expect(boxes[0]).toHaveTextContent(ACTION_TEXT); await toggleOpenMessageActions(1); boxes = screen.getAllByTestId('message-actions-box'); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(boxes).toHaveLength(1); expect(boxes[0]).toHaveTextContent(ACTION_TEXT); }); diff --git a/src/components/MessageInput/AttachmentSelector.tsx b/src/components/MessageInput/AttachmentSelector.tsx index 1fc7a935cd..4203bae2ba 100644 --- a/src/components/MessageInput/AttachmentSelector.tsx +++ b/src/components/MessageInput/AttachmentSelector.tsx @@ -80,7 +80,6 @@ export type AttachmentSelectorActionProps = { export type AttachmentSelectorAction = { ActionButton: React.ComponentType; - // eslint-disable-next-line @typescript-eslint/ban-types type: 'uploadFile' | 'createPoll' | (string & {}); ModalContent?: React.ComponentType; }; diff --git a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js index 003d7ae359..3e8a1ebdfe 100644 --- a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js +++ b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest-dom/prefer-in-document */ + import React from 'react'; diff --git a/src/components/MessageInput/__tests__/LinkPreviewList.test.js b/src/components/MessageInput/__tests__/LinkPreviewList.test.js index dc22bca02d..86509beac3 100644 --- a/src/components/MessageInput/__tests__/LinkPreviewList.test.js +++ b/src/components/MessageInput/__tests__/LinkPreviewList.test.js @@ -25,9 +25,9 @@ import '@testing-library/jest-dom'; // Mock out lodash debounce implementation, so it calls the debounced method immediately jest.mock('lodash.debounce', () => jest.fn((fn) => { - //eslint-disable-next-line + fn.cancel = jest.fn(); - //eslint-disable-next-line + fn.flush = jest.fn(); return fn; }), @@ -341,7 +341,7 @@ describe('Link preview', () => { }); }); const linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); }); @@ -384,7 +384,7 @@ describe('Link preview', () => { }); }); let linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); @@ -396,7 +396,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(2); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -409,7 +409,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(3); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -451,7 +451,7 @@ describe('Link preview', () => { await waitFor(() => { const linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(3); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -473,7 +473,7 @@ describe('Link preview', () => { }); }); let linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -485,7 +485,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); }); @@ -562,7 +562,7 @@ describe('Link preview', () => { }); }); let linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -574,7 +574,7 @@ describe('Link preview', () => { }); }); linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(0); }); @@ -593,7 +593,7 @@ describe('Link preview', () => { }); }); let linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -601,7 +601,7 @@ describe('Link preview', () => { fireEvent.click(await screen.findByTestId(LINK_PREVIEW_DISMISS_BTN_TEST_ID)); }); linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(0); await act(async () => { @@ -830,7 +830,7 @@ describe('Link preview', () => { }); const linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - // eslint-disable-next-line + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); }); @@ -950,10 +950,11 @@ describe('Link preview', () => { it('submit new message with skip_url_enrich:false if no link previews managed to get loaded', async () => { const channel = chatClient.channel('messaging', mockedChannelData.channel.id); const sendMessageSpy = jest.spyOn(channel, 'sendMessage').mockImplementation(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars let resolveEnrichURLPromise; jest .spyOn(chatClient, 'enrichURL') - // eslint-disable-next-line no-unused-vars + .mockImplementationOnce(() => new Promise((res) => (resolveEnrichURLPromise = res))); const { submit } = await renderComponent({ @@ -987,10 +988,11 @@ describe('Link preview', () => { const sendMessageSpy = jest.spyOn(channel, 'sendMessage').mockImplementation(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars let resolveEnrichURLPromise; jest .spyOn(chatClient, 'enrichURL') - // eslint-disable-next-line no-unused-vars + .mockImplementationOnce(() => new Promise((res) => (resolveEnrichURLPromise = res))); const { submit } = await renderComponent({ diff --git a/src/components/MessageInput/__tests__/MessageInput.test.js b/src/components/MessageInput/__tests__/MessageInput.test.js index cac2baeca8..94f14c7b23 100644 --- a/src/components/MessageInput/__tests__/MessageInput.test.js +++ b/src/components/MessageInput/__tests__/MessageInput.test.js @@ -957,7 +957,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for image uploading to complete before trying to send the message - // eslint-disable-next-line jest/prefer-called-with + await waitFor(() => expect(doImageUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1001,7 +1001,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for file uploading to complete before trying to send the message - // eslint-disable-next-line jest/prefer-called-with + await waitFor(() => expect(doFileUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1047,7 +1047,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for file uploading to complete before trying to send the message - // eslint-disable-next-line jest/prefer-called-with + await waitFor(() => expect(doFileUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1396,7 +1396,7 @@ function axeNoViolations(container) { if (componentName !== 'EditMessageForm') { await waitFor( - () => expect(screen.getByTestId('suggestion-list')).toBeInTheDocument(), // eslint-disable-line + () => expect(screen.getByTestId('suggestion-list')).toBeInTheDocument(), ); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/MessageInput/hooks/useLinkPreviews.ts b/src/components/MessageInput/hooks/useLinkPreviews.ts index 5f37dd2d6b..9113888d0d 100644 --- a/src/components/MessageInput/hooks/useLinkPreviews.ts +++ b/src/components/MessageInput/hooks/useLinkPreviews.ts @@ -138,7 +138,7 @@ export const useLinkPreviews = < enqueuedLinks.forEach((linkPreview) => { client .enrichURL(linkPreview.og_scrape_url) - // eslint-disable-next-line @typescript-eslint/no-unused-vars + .then(({ duration, ...ogAttachment }) => { if (shouldDiscardEnrichQueries.current) return; diff --git a/src/components/MessageInput/hooks/useSubmitHandler.ts b/src/components/MessageInput/hooks/useSubmitHandler.ts index 5df169afd7..728cdb85fe 100644 --- a/src/components/MessageInput/hooks/useSubmitHandler.ts +++ b/src/components/MessageInput/hooks/useSubmitHandler.ts @@ -113,7 +113,7 @@ export const useSubmitHandler = < (attFromUpload) => attFromUpload.og_scrape_url === linkPreview.og_scrape_url, ), ) - // eslint-disable-next-line @typescript-eslint/no-unused-vars + .map(({ state: linkPreviewState, ...ogAttachment }) => ogAttachment as Attachment); // scraped attachments are added only if all enrich queries has completed. Otherwise, the scraping has to be done server-side. diff --git a/src/components/MessageInput/hooks/useUserTrigger.ts b/src/components/MessageInput/hooks/useUserTrigger.ts index e02b190f3b..e5e13bd917 100644 --- a/src/components/MessageInput/hooks/useUserTrigger.ts +++ b/src/components/MessageInput/hooks/useUserTrigger.ts @@ -68,7 +68,7 @@ export const useUserTrigger = < throttle( async (query: string, onReady: (users: UserResponse[]) => void) => { try { - // @ts-expect-error + // @ts-expect-error this is a valid query const response = await channel.queryMembers({ name: { $autocomplete: query }, }); @@ -100,7 +100,7 @@ export const useUserTrigger = < try { const { users } = await client.queryUsers( - // @ts-expect-error + // @ts-expect-error this is a valid query { $or: [{ id: { $autocomplete: query } }, { name: { $autocomplete: query } }], ...(typeof mentionQueryParams.filters === 'function' diff --git a/src/components/MessageInput/hooks/utils.ts b/src/components/MessageInput/hooks/utils.ts index e73c212a4e..84917dcd65 100644 --- a/src/components/MessageInput/hooks/utils.ts +++ b/src/components/MessageInput/hooks/utils.ts @@ -86,6 +86,7 @@ export const searchLocalUsers = < if (useMentionsTransliteration) { (async () => { + // eslint-disable-next-line import/no-extraneous-dependencies const { default: transliterate } = await import('@stream-io/transliterate'); updatedName = transliterate(user.name || '').toLowerCase(); updatedQuery = transliterate(query).toLowerCase(); diff --git a/src/components/MessageList/MessageList.tsx b/src/components/MessageList/MessageList.tsx index 21a9fcd884..e2012383e0 100644 --- a/src/components/MessageList/MessageList.tsx +++ b/src/components/MessageList/MessageList.tsx @@ -400,9 +400,9 @@ export const MessageList = < } = useChannelActionContext('MessageList'); const { - members: membersPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - mutes: mutesPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars - watchers: watchersPropToNotPass, // eslint-disable-line @typescript-eslint/no-unused-vars + members: membersPropToNotPass, + mutes: mutesPropToNotPass, + watchers: watchersPropToNotPass, ...restChannelStateContext } = useChannelStateContext('MessageList'); diff --git a/src/components/MessageList/__tests__/CustomNotification.test.js b/src/components/MessageList/__tests__/CustomNotification.test.js index a174675eec..adda5ddc41 100644 --- a/src/components/MessageList/__tests__/CustomNotification.test.js +++ b/src/components/MessageList/__tests__/CustomNotification.test.js @@ -1,4 +1,4 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ + import React from 'react'; import renderer from 'react-test-renderer'; import { cleanup, render } from '@testing-library/react'; @@ -6,7 +6,7 @@ import { cleanup, render } from '@testing-library/react'; import { CustomNotification } from '../CustomNotification'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('CustomNotification', () => { it('should render nothing if active is false', () => { diff --git a/src/components/MessageList/__tests__/MessageList.test.js b/src/components/MessageList/__tests__/MessageList.test.js index eeaced487f..3b3f3094a2 100644 --- a/src/components/MessageList/__tests__/MessageList.test.js +++ b/src/components/MessageList/__tests__/MessageList.test.js @@ -364,7 +364,7 @@ describe('MessageList', () => { return null; } } - // eslint-disable-next-line jest/prefer-spy-on + window.IntersectionObserver = IntersectionObserverMock; }); afterEach(jest.clearAllMocks); diff --git a/src/components/MessageList/__tests__/MessageNotification.test.js b/src/components/MessageList/__tests__/MessageNotification.test.js index 02eef9cf9a..dd8d021937 100644 --- a/src/components/MessageList/__tests__/MessageNotification.test.js +++ b/src/components/MessageList/__tests__/MessageNotification.test.js @@ -7,7 +7,7 @@ expect.extend(toHaveNoViolations); import { MessageNotification } from '../MessageNotification'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('MessageNotification', () => { it('should render nothing if showNotification is false', () => { diff --git a/src/components/MessageList/__tests__/ScrollToBottomButton.test.js b/src/components/MessageList/__tests__/ScrollToBottomButton.test.js index 8901acce96..83236055cf 100644 --- a/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +++ b/src/components/MessageList/__tests__/ScrollToBottomButton.test.js @@ -94,7 +94,7 @@ describe.each([ }); await waitFor(() => { - // eslint-disable-next-line jest/prefer-called-with + expect(onClick).toHaveBeenCalled(); }); }); diff --git a/src/components/MessageList/utils.ts b/src/components/MessageList/utils.ts index bd762869c4..5379246430 100644 --- a/src/components/MessageList/utils.ts +++ b/src/components/MessageList/utils.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-continue */ + import { nanoid } from 'nanoid'; import { CUSTOM_MESSAGE_TYPE } from '../../constants/messageTypes'; @@ -369,7 +369,6 @@ type DateSeparatorMessage = { export function isDateSeparatorMessage< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics - // @ts-ignore >(message: StreamMessage): message is DateSeparatorMessage { return message.customType === CUSTOM_MESSAGE_TYPE.date && !!message.date && isDate(message.date); } diff --git a/src/components/Modal/__tests__/Modal.test.js b/src/components/Modal/__tests__/Modal.test.js index 74227161b8..a462454ffd 100644 --- a/src/components/Modal/__tests__/Modal.test.js +++ b/src/components/Modal/__tests__/Modal.test.js @@ -6,7 +6,7 @@ import '@testing-library/jest-dom'; import { Modal } from '../Modal'; describe('Modal', () => { - afterEach(cleanup); // eslint-disable-line + afterEach(cleanup); it('should be closed (null) if the `open` prop is set to false', () => { const { container } = render( {}} open={false} />); diff --git a/src/components/Poll/__tests__/PollCreationDialog.test.js b/src/components/Poll/__tests__/PollCreationDialog.test.js index ac1c03dcdd..7be590b39d 100644 --- a/src/components/Poll/__tests__/PollCreationDialog.test.js +++ b/src/components/Poll/__tests__/PollCreationDialog.test.js @@ -166,7 +166,7 @@ describe('PollCreationDialog', () => { await fireEvent.blur(optionFields[1]); }); const optionErrors = screen.getAllByTestId(OPTION_INPUT_FIELD_ERROR_TEST_ID); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(optionErrors).toHaveLength(3); expect(optionErrors[1]).toHaveTextContent(DUPLICATE_OPTION_FIELD_ERROR_TEXT); expect(screen.getByText(CANCEL_BUTTON_TEXT)).toBeEnabled(); @@ -196,7 +196,7 @@ describe('PollCreationDialog', () => { expect(optionFields[1]).toHaveValue(text); expect(optionFields[2]).toHaveValue(''); const optionErrors = screen.getAllByTestId(OPTION_INPUT_FIELD_ERROR_TEST_ID); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(optionErrors).toHaveLength(3); expect(optionErrors[0]).not.toHaveTextContent(); expect(optionErrors[1]).not.toHaveTextContent(); @@ -221,7 +221,7 @@ describe('PollCreationDialog', () => { await fireEvent.change(optionFields[0], { target: { value: '' } }); }); optionFields = screen.getAllByPlaceholderText(OPTION_FIELD_PLACEHOLDER); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(optionFields).toHaveLength(1); expect(screen.getByText(CANCEL_BUTTON_TEXT)).toBeEnabled(); expect(screen.getByText(CREATE_BUTTON_TEXT)).toBeDisabled(); @@ -284,7 +284,7 @@ describe('PollCreationDialog', () => { }); const maxVoteCountErrors = screen.getAllByTestId(MAX_VOTE_COUT_INPUT_FIELD_ERROR_TEST_ID); - // eslint-disable-next-line jest-dom/prefer-in-document + expect(maxVoteCountErrors).toHaveLength(1); expect(maxVoteCountErrors[0]).toHaveTextContent(MAX_VOTE_COUNT_FIELD_ERROR_TEXT); expect(screen.getByPlaceholderText(MAX_VOTES_FIELD_PLACEHOLDER).value).toBe('1'); diff --git a/src/components/Reactions/__tests__/ReactionsList.test.js b/src/components/Reactions/__tests__/ReactionsList.test.js index dfd7af0129..7ae059d700 100644 --- a/src/components/Reactions/__tests__/ReactionsList.test.js +++ b/src/components/Reactions/__tests__/ReactionsList.test.js @@ -1,4 +1,4 @@ -/* eslint-disable react/display-name */ + import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; diff --git a/src/components/Reactions/reactionOptions.tsx b/src/components/Reactions/reactionOptions.tsx index a0dc77735f..c20dc77d44 100644 --- a/src/components/Reactions/reactionOptions.tsx +++ b/src/components/Reactions/reactionOptions.tsx @@ -1,5 +1,5 @@ /* eslint-disable sort-keys */ -/* eslint-disable react/display-name */ + import React from 'react'; import { StreamEmoji } from './StreamEmoji'; diff --git a/src/components/Thread/Thread.tsx b/src/components/Thread/Thread.tsx index 3f1bcb1007..f7060e3096 100644 --- a/src/components/Thread/Thread.tsx +++ b/src/components/Thread/Thread.tsx @@ -135,7 +135,7 @@ const ThreadInner = < // FIXME: integrators can customize channel query options but cannot customize channel.getReplies() options loadMoreThread(); } - // eslint-disable-next-line react-hooks/exhaustive-deps + }, [thread, loadMoreThread]); const threadProps: Pick< diff --git a/src/components/Threads/icons.tsx b/src/components/Threads/icons.tsx index d67e416279..db34559da7 100644 --- a/src/components/Threads/icons.tsx +++ b/src/components/Threads/icons.tsx @@ -1,4 +1,4 @@ -/* eslint-disable react/display-name */ + import React from 'react'; import { ComponentPropsWithoutRef } from 'react'; diff --git a/src/components/UserItem/__tests__/UserItem.test.js b/src/components/UserItem/__tests__/UserItem.test.js index 1e6461f275..33abfa52a6 100644 --- a/src/components/UserItem/__tests__/UserItem.test.js +++ b/src/components/UserItem/__tests__/UserItem.test.js @@ -8,7 +8,7 @@ expect.extend(toHaveNoViolations); import { UserItem } from '../UserItem'; -afterEach(cleanup); // eslint-disable-line +afterEach(cleanup); describe('UserItem', () => { it('should render component with default props', () => { diff --git a/src/context/ComponentContext.tsx b/src/context/ComponentContext.tsx index 43e35342c9..493e4414dc 100644 --- a/src/context/ComponentContext.tsx +++ b/src/context/ComponentContext.tsx @@ -217,7 +217,7 @@ export const useComponentContext = < /** * @deprecated */ - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars _componentName?: string, ) => (useContext(ComponentContext) as unknown) as ComponentContextValue; diff --git a/src/context/MessageContext.tsx b/src/context/MessageContext.tsx index 74e6d7a77e..257671be1d 100644 --- a/src/context/MessageContext.tsx +++ b/src/context/MessageContext.tsx @@ -158,7 +158,7 @@ export const MessageProvider = < export const useMessageContext = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics >( - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars _componentName?: string, ) => { const contextValue = useContext(MessageContext); diff --git a/src/experimental/MessageActions/MessageActions.tsx b/src/experimental/MessageActions/MessageActions.tsx index 47da9e86a2..26cc0c45cf 100644 --- a/src/experimental/MessageActions/MessageActions.tsx +++ b/src/experimental/MessageActions/MessageActions.tsx @@ -1,4 +1,4 @@ -/* eslint-disable sort-keys */ + import clsx from 'clsx'; import React, { PropsWithChildren, useState } from 'react'; @@ -16,7 +16,6 @@ export type MessageActionSetItem = { placement: 'quick' | 'dropdown'; type: | keyof typeof MESSAGE_ACTIONS - // eslint-disable-next-line @typescript-eslint/ban-types | (string & {}); }; diff --git a/src/i18n/__tests__/Streami18n.test.js b/src/i18n/__tests__/Streami18n.test.js index 99db652bd5..c84c183400 100644 --- a/src/i18n/__tests__/Streami18n.test.js +++ b/src/i18n/__tests__/Streami18n.test.js @@ -1,9 +1,10 @@ -/* eslint-disable */ +/* eslint-disable sort-keys */ + import { Streami18n } from '../Streami18n'; import { nanoid } from 'nanoid'; import { default as Dayjs } from 'dayjs'; import moment from 'moment-timezone'; -import { nlTranslations, frTranslations } from '../translations'; +import { frTranslations, nlTranslations } from '../translations'; import 'dayjs/locale/nl'; import localeData from 'dayjs/plugin/localeData'; Dayjs.extend(localeData); @@ -270,7 +271,7 @@ describe('Streami18n timezone', () => { }); it('allows to override the default timestampFormatter', async () => { const i18n = new Streami18n({ - formatters: { timestampFormatter: (s) => () => 'custom' }, + formatters: { timestampFormatter: () => () => 'custom' }, translationsForLanguage: { abc: '{{ value | timestampFormatter }}' }, }); await i18n.init(); @@ -278,7 +279,7 @@ describe('Streami18n timezone', () => { }); it('allows to add new custom formatter', async () => { const i18n = new Streami18n({ - formatters: { customFormatter: (s) => () => 'custom' }, + formatters: { customFormatter: () => () => 'custom' }, translationsForLanguage: { abc: '{{ value | customFormatter }}' }, }); await i18n.init(); diff --git a/src/mock-builders/generator/attachment.js b/src/mock-builders/generator/attachment.js index 21611da0fe..74fd887817 100644 --- a/src/mock-builders/generator/attachment.js +++ b/src/mock-builders/generator/attachment.js @@ -45,7 +45,7 @@ export const generateLocalImageUploadAttachmentData = (overrides, attachmentData ...generateLocalFileUploadAttachmentData().localMetadata, previewUri: 'image-preview-uri', ...overrides, - // eslint-disable-next-line sort-keys + file: generateImageFile(overrides?.file ?? {}), }, type: 'image', diff --git a/src/mock-builders/generator/channel.js b/src/mock-builders/generator/channel.js index e19d01a5d0..2fcabce2a7 100644 --- a/src/mock-builders/generator/channel.js +++ b/src/mock-builders/generator/channel.js @@ -11,10 +11,10 @@ export const generateChannel = (options = { channel: {} }) => { messages: [], pinnedMessages: [], ...optionsBesidesChannel, - // eslint-disable-next-line sort-keys + channel: { cid: `${type}:${id}`, - // eslint-disable-next-line sort-keys + config: { automod: 'disabled', automod_behavior: 'flag', diff --git a/src/mock-builders/index.js b/src/mock-builders/index.js index ada1049fc7..e90be9f8ab 100644 --- a/src/mock-builders/index.js +++ b/src/mock-builders/index.js @@ -1,4 +1,4 @@ -/* eslint-disable no-param-reassign */ + /* eslint-disable no-underscore-dangle */ import { StreamChat } from 'stream-chat'; import { nanoid } from 'nanoid'; diff --git a/src/mock-builders/utils.js b/src/mock-builders/utils.js index 5cc6e61bbc..0b1f32d435 100644 --- a/src/mock-builders/utils.js +++ b/src/mock-builders/utils.js @@ -45,7 +45,7 @@ export const initClientWithChannels = async ({ channelsData, customUser } = {}) ...channelData, }); - // eslint-disable-next-line react-hooks/rules-of-hooks + useMockedApis(client, [getOrCreateChannelApi(mockedChannelData)]); const channel = client.channel(mockedChannelData.channel.type, mockedChannelData.channel.id); await channel.watch(); diff --git a/src/plugins/Emojis/EmojiPicker.tsx b/src/plugins/Emojis/EmojiPicker.tsx index 4146e0e914..bc928dac6c 100644 --- a/src/plugins/Emojis/EmojiPicker.tsx +++ b/src/plugins/Emojis/EmojiPicker.tsx @@ -1,4 +1,3 @@ -/* eslint-disable typescript-sort-keys/interface */ import React, { useEffect, useState } from 'react'; import { usePopper } from 'react-popper'; import Picker from '@emoji-mart/react'; diff --git a/src/stories/add-message.stories.tsx b/src/stories/add-message.stories.tsx index 8fa43a6db4..31fc8fa9d6 100644 --- a/src/stories/add-message.stories.tsx +++ b/src/stories/add-message.stories.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import React from 'react'; import type { ChannelSort } from 'stream-chat'; import { diff --git a/src/stories/hello.stories.tsx b/src/stories/hello.stories.tsx index d818817a08..aa939e6604 100644 --- a/src/stories/hello.stories.tsx +++ b/src/stories/hello.stories.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import React from 'react'; import type { ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat'; import { diff --git a/src/stories/jump-to-message.stories.tsx b/src/stories/jump-to-message.stories.tsx index 2a06a4ee98..2f61479c75 100644 --- a/src/stories/jump-to-message.stories.tsx +++ b/src/stories/jump-to-message.stories.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import React from 'react'; import { Channel, diff --git a/src/stories/mark-read.stories.tsx b/src/stories/mark-read.stories.tsx index a6349e3fdf..bdb617d758 100644 --- a/src/stories/mark-read.stories.tsx +++ b/src/stories/mark-read.stories.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import React from 'react'; import type { ChannelSort } from 'stream-chat'; import { nanoid } from 'nanoid'; diff --git a/src/stories/message-status-readby-tooltip.stories.tsx b/src/stories/message-status-readby-tooltip.stories.tsx index cc8878a63b..1582841b12 100644 --- a/src/stories/message-status-readby-tooltip.stories.tsx +++ b/src/stories/message-status-readby-tooltip.stories.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ + import React, { useCallback } from 'react'; import type { ChannelSort } from 'stream-chat'; import { diff --git a/src/types/types.ts b/src/types/types.ts index 1b4beaf00e..b25dac85c2 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -41,7 +41,7 @@ export type DefaultChannelType = UnknownType & { }; export type DefaultMessageType< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = UnknownType & { customType?: CustomMessageType; date?: string | Date; @@ -57,7 +57,7 @@ export type DefaultUserTypeInternal = { }; export type DefaultUserType< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = UnknownType & DefaultUserTypeInternal & { mutes?: Array>; @@ -135,7 +135,7 @@ export type VideoAttachmentSizeHandler = ( ) => VideoAttachmentConfiguration; export type ChannelUnreadUiState< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit['read']>, 'user'>; // todo: fix export from stream-chat - for some reason not exported @@ -156,7 +156,6 @@ export type UpdateMessageOptions = { export type Readable = { [key in keyof T]: T[key]; - // eslint-disable-next-line @typescript-eslint/ban-types } & {}; export type ValuesType = T[keyof T]; diff --git a/yarn.lock b/yarn.lock index 65bda3f93d..e612548a8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -324,7 +324,7 @@ regenerator-runtime "^0.13.4" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.17.8", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.24.7", "@babel/parser@^7.7.0": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.17.8", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== @@ -1040,15 +1040,7 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime-corejs3@^7.10.2": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.13.10.tgz#14c3f4c85de22ba88e8e86685d13e8861a82fe86" - integrity sha512-x/XYVQ1h684pp1mJwOV4CyvqZXqbc8CMsMGUnAbuc82ZCdv1U63w5RSUzgDSXQHG5Rps/kiksH6g2D5BuaKyXg== - dependencies: - core-js-pure "^3.0.0" - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.21.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.21.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== @@ -1064,7 +1056,7 @@ "@babel/parser" "^7.24.7" "@babel/types" "^7.24.7" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.24.7", "@babel/traverse@^7.7.0": +"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== @@ -1080,7 +1072,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.24.7", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.24.7", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.7.tgz#6027fe12bc1aa724cd32ab113fb7f1988f1f66f2" integrity sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q== @@ -1403,39 +1395,99 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz#81fd50d11e2c32b2d6241470e3185b70c7b30699" integrity sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg== -"@eslint-community/eslint-utils@^4.2.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz#d1145bf2c20132d6400495d6df4bf59362fd9d56" + integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== dependencies: - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.3" -"@eslint-community/regexpp@^4.4.0": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" - integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== -"@eslint/eslintrc@^0.2.1": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" - integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== +"@eslint/config-array@^0.19.0": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.1.tgz#734aaea2c40be22bbb1f2a9dac687c57a6a4c984" + integrity sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA== + dependencies: + "@eslint/object-schema" "^2.1.5" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/core@^0.9.0": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.9.1.tgz#31763847308ef6b7084a4505573ac9402c51f9d1" + integrity sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/eslintrc@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.2.0.tgz#57470ac4e2e283a6bf76044d63281196e370542c" + integrity sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^12.1.0" - ignore "^4.0.6" + debug "^4.3.2" + espree "^10.0.1" + globals "^14.0.0" + ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^3.13.1" - lodash "^4.17.19" - minimatch "^3.0.4" + js-yaml "^4.1.0" + minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@9.16.0", "@eslint/js@^9.16.0": + version "9.16.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.16.0.tgz#3df2b2dd3b9163056616886c86e4082f45dbf3f4" + integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg== + +"@eslint/object-schema@^2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.5.tgz#8670a8f6258a2be5b2c620ff314a1d984c23eb2e" + integrity sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ== + +"@eslint/plugin-kit@^0.2.3": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz#2b78e7bb3755784bb13faa8932a1d994d6537792" + integrity sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg== + dependencies: + levn "^0.4.1" + "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== +"@humanfs/core@^0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" + integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== + +"@humanfs/node@^0.16.6": + version "0.16.6" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.6.tgz#ee2a10eaabd1131987bf0488fd9b820174cd765e" + integrity sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw== + dependencies: + "@humanfs/core" "^0.19.1" + "@humanwhocodes/retry" "^0.3.0" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/retry@^0.3.0": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" + integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== + +"@humanwhocodes/retry@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b" + integrity sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA== + "@isaacs/string-locale-compare@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b" @@ -1687,17 +1739,6 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - "@jest/types@^27.4.0": version "27.4.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.0.tgz#ac5c04d29ce47e0b96439dfd44ec3cd930fc9f86" @@ -2205,6 +2246,11 @@ estree-walker "^2.0.1" picomatch "^2.2.2" +"@rtsao/scc@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" + integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== + "@semantic-release/changelog@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.2.tgz#fdcdbd368788c8fcc69c4af29bf2064f4afb45f4" @@ -2388,20 +2434,6 @@ dependencies: tslib "^2.4.0" -"@testing-library/dom@^7.28.1": - version "7.30.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.30.0.tgz#53697851f7708a1448cc30b74a2ea056dd709cd6" - integrity sha512-v4GzWtltaiDE0yRikLlcLAfEiiK8+ptu6OuuIebm9GdC2XlZTNDPGEfM2UkEtnH7hr9TRq2sivT5EA9P1Oy7bw== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^4.2.2" - chalk "^4.1.0" - dom-accessibility-api "^0.5.4" - lz-string "^1.4.4" - pretty-format "^26.6.2" - "@testing-library/dom@^8.5.0": version "8.13.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.13.0.tgz#bc00bdd64c7d8b40841e27a70211399ad3af46f5" @@ -2514,6 +2546,11 @@ dependencies: dotenv "*" +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -2572,10 +2609,10 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@^7.0.7", "@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/json-schema@^7.0.15": + 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" @@ -2739,11 +2776,6 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff" integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A== -"@types/semver@^7.3.12": - version "7.3.13" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" - integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== - "@types/stack-utils@^2.0.0": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" @@ -2786,13 +2818,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== -"@types/yargs@^15.0.0": - version "15.0.15" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.15.tgz#e609a2b1ef9e05d90489c2f5f45bbfb2be092158" - integrity sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^16.0.0": version "16.0.4" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" @@ -2807,190 +2832,86 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" - integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== +"@typescript-eslint/eslint-plugin@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz#2ee073c421f4e81e02d10e731241664b6253b23c" + integrity sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w== dependencies: - "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/type-utils" "5.62.0" - "@typescript-eslint/utils" "5.62.0" - debug "^4.3.4" + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "8.17.0" + "@typescript-eslint/type-utils" "8.17.0" + "@typescript-eslint/utils" "8.17.0" + "@typescript-eslint/visitor-keys" "8.17.0" graphemer "^1.4.0" - ignore "^5.2.0" - natural-compare-lite "^1.4.0" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/experimental-utils@^4.0.1": - version "4.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.27.0.tgz#78192a616472d199f084eab8f10f962c0757cd1c" - integrity sha512-n5NlbnmzT2MXlyT+Y0Jf0gsmAQzCnQSWXKy4RGSXVStjDvS5we9IWbh7qRVKdGcxT0WYlgcCYUK/HRg7xFhvjQ== - dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.27.0" - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/typescript-estree" "4.27.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/experimental-utils@^5.0.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.54.0.tgz#78ffdbc10a46be943f07d82ebfc7ea3ab8148cd0" - integrity sha512-rRYECOTh5V3iWsrOzXi7h1jp3Bi9OkJHrb3wECi3DVqMGTilo9wAYmCbT+6cGdrzUY3MWcAa2mESM6FMik6tVw== - dependencies: - "@typescript-eslint/utils" "5.54.0" - -"@typescript-eslint/parser@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7" - integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== - dependencies: - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@4.27.0": - version "4.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.27.0.tgz#b0b1de2b35aaf7f532e89c8e81d0fa298cae327d" - integrity sha512-DY73jK6SEH6UDdzc6maF19AHQJBFVRf6fgAXHPXCGEmpqD4vYgPEzqpFz1lf/daSbOcMpPPj9tyXXDPW2XReAw== - dependencies: - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" -"@typescript-eslint/scope-manager@5.54.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz#74b28ac9a3fc8166f04e806c957adb8c1fd00536" - integrity sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg== +"@typescript-eslint/parser@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.17.0.tgz#2ee972bb12fa69ac625b85813dc8d9a5a053ff52" + integrity sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg== dependencies: - "@typescript-eslint/types" "5.54.0" - "@typescript-eslint/visitor-keys" "5.54.0" + "@typescript-eslint/scope-manager" "8.17.0" + "@typescript-eslint/types" "8.17.0" + "@typescript-eslint/typescript-estree" "8.17.0" + "@typescript-eslint/visitor-keys" "8.17.0" + debug "^4.3.4" -"@typescript-eslint/scope-manager@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" - integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== +"@typescript-eslint/scope-manager@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz#a3f49bf3d4d27ff8d6b2ea099ba465ef4dbcaa3a" + integrity sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg== dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" + "@typescript-eslint/types" "8.17.0" + "@typescript-eslint/visitor-keys" "8.17.0" -"@typescript-eslint/type-utils@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz#286f0389c41681376cdad96b309cedd17d70346a" - integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== +"@typescript-eslint/type-utils@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz#d326569f498cdd0edf58d5bb6030b4ad914e63d3" + integrity sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw== dependencies: - "@typescript-eslint/typescript-estree" "5.62.0" - "@typescript-eslint/utils" "5.62.0" + "@typescript-eslint/typescript-estree" "8.17.0" + "@typescript-eslint/utils" "8.17.0" debug "^4.3.4" - tsutils "^3.21.0" - -"@typescript-eslint/types@4.27.0": - version "4.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.27.0.tgz#712b408519ed699baff69086bc59cd2fc13df8d8" - integrity sha512-I4ps3SCPFCKclRcvnsVA/7sWzh7naaM/b4pBO2hVxnM3wrU51Lveybdw5WoIktU/V4KfXrTt94V9b065b/0+wA== - -"@typescript-eslint/types@5.54.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.54.0.tgz#7d519df01f50739254d89378e0dcac504cab2740" - integrity sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ== - -"@typescript-eslint/types@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" - integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== - -"@typescript-eslint/typescript-estree@4.27.0": - version "4.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.27.0.tgz#189a7b9f1d0717d5cccdcc17247692dedf7a09da" - integrity sha512-KH03GUsUj41sRLLEy2JHstnezgpS5VNhrJouRdmh6yNdQ+yl8w5LrSwBkExM+jWwCJa7Ct2c8yl8NdtNRyQO6g== - dependencies: - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" + ts-api-utils "^1.3.0" -"@typescript-eslint/typescript-estree@5.54.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz#f6f3440cabee8a43a0b25fa498213ebb61fdfe99" - integrity sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ== - dependencies: - "@typescript-eslint/types" "5.54.0" - "@typescript-eslint/visitor-keys" "5.54.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" +"@typescript-eslint/types@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.17.0.tgz#ef84c709ef8324e766878834970bea9a7e3b72cf" + integrity sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA== -"@typescript-eslint/typescript-estree@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" - integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== +"@typescript-eslint/typescript-estree@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz#40b5903bc929b1e8dd9c77db3cb52cfb199a2a34" + integrity sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw== dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" + "@typescript-eslint/types" "8.17.0" + "@typescript-eslint/visitor-keys" "8.17.0" debug "^4.3.4" - globby "^11.1.0" + fast-glob "^3.3.2" is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/utils@5.54.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.54.0.tgz#3db758aae078be7b54b8ea8ea4537ff6cd3fbc21" - integrity sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw== - dependencies: - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.54.0" - "@typescript-eslint/types" "5.54.0" - "@typescript-eslint/typescript-estree" "5.54.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - semver "^7.3.7" - -"@typescript-eslint/utils@5.62.0", "@typescript-eslint/utils@^5.58.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" - integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - eslint-scope "^5.1.1" - semver "^7.3.7" - -"@typescript-eslint/visitor-keys@4.27.0": - version "4.27.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.27.0.tgz#f56138b993ec822793e7ebcfac6ffdce0a60cb81" - integrity sha512-es0GRYNZp0ieckZ938cEANfEhsfHrzuLrePukLKtY3/KPXcq1Xd555Mno9/GOgXhKzn0QfkDLVgqWO3dGY80bg== - dependencies: - "@typescript-eslint/types" "4.27.0" - eslint-visitor-keys "^2.0.0" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" -"@typescript-eslint/visitor-keys@5.54.0": - version "5.54.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.0.tgz#846878afbf0cd67c19cfa8d75947383d4490db8f" - integrity sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA== +"@typescript-eslint/utils@8.17.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.17.0.tgz#41c05105a2b6ab7592f513d2eeb2c2c0236d8908" + integrity sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w== dependencies: - "@typescript-eslint/types" "5.54.0" - eslint-visitor-keys "^3.3.0" + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.17.0" + "@typescript-eslint/types" "8.17.0" + "@typescript-eslint/typescript-estree" "8.17.0" -"@typescript-eslint/visitor-keys@5.62.0": - version "5.62.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" - integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== +"@typescript-eslint/visitor-keys@8.17.0": + version "8.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz#4dbcd0e28b9bf951f4293805bf34f98df45e1aa8" + integrity sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg== dependencies: - "@typescript-eslint/types" "5.62.0" - eslint-visitor-keys "^3.3.0" + "@typescript-eslint/types" "8.17.0" + eslint-visitor-keys "^4.2.0" "@virtuoso.dev/react-urx@^0.2.12": version "0.2.12" @@ -3052,7 +2973,7 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^5.2.0, acorn-jsx@^5.3.1: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -3062,11 +2983,16 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.14.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + acorn@^8.5.0: version "8.11.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" @@ -3108,7 +3034,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -3135,11 +3061,6 @@ ansi-align@^3.0.0: dependencies: string-width "^4.1.0" -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -3166,12 +3087,7 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== -ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== - -ansi-regex@^5.0.0, ansi-regex@^5.0.1: +ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -3186,7 +3102,7 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -3278,14 +3194,6 @@ argv@0.0.2: resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas= -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - aria-query@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.0.0.tgz#210c21aaf469613ee8c9a62c7f86525e058db52c" @@ -3306,6 +3214,14 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== +array-buffer-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" + integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== + dependencies: + call-bind "^1.0.5" + is-array-buffer "^3.0.4" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -3316,16 +3232,17 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== -array-includes@^3.1.1, array-includes@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== +array-includes@^3.1.6, array-includes@^3.1.8: + version "3.1.8" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" + integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - get-intrinsic "^1.1.1" - is-string "^1.0.5" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + is-string "^1.0.7" array-union@^2.1.0: version "2.1.0" @@ -3337,24 +3254,49 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== -array.prototype.flat@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" - integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== +array.prototype.findlast@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz#3e4fbcb30a15a7f5bf64cf2faae22d139c2e4904" + integrity sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" + +array.prototype.findlastindex@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" + integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-shim-unscopables "^1.0.2" + +array.prototype.flat@^1.3.1, array.prototype.flat@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" + integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" -array.prototype.flatmap@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== +array.prototype.flatmap@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" array.prototype.reduce@^1.0.5: version "1.0.5" @@ -3367,6 +3309,31 @@ array.prototype.reduce@^1.0.5: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +array.prototype.tosorted@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz#fe954678ff53034e717ea3352a03f0b0b86f7ffc" + integrity sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" + es-errors "^1.3.0" + es-shim-unscopables "^1.0.2" + +arraybuffer.prototype.slice@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" + integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.5" + define-properties "^1.2.1" + es-abstract "^1.22.3" + es-errors "^1.2.1" + get-intrinsic "^1.2.3" + is-array-buffer "^3.0.4" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -3392,11 +3359,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== -ast-types-flow@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" - integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= - ast-types@^0.14.0: version "0.14.2" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd" @@ -3404,11 +3366,6 @@ ast-types@^0.14.0: dependencies: tslib "^2.0.1" -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - async-each@^1.0.1: version "1.0.6" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.6.tgz#52f1d9403818c179b7561e11a5d1b77eb2160e77" @@ -3446,7 +3403,14 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -axe-core@4.7.2, axe-core@^4.0.2, axe-core@^4.3.3, axe-core@^4.4.1: +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + +axe-core@4.7.2, axe-core@^4.3.3, axe-core@^4.4.1: version "4.7.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.2.tgz#040a7342b20765cb18bb50b628394c21bccc17a0" integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== @@ -3460,11 +3424,6 @@ axios@^1.6.0: form-data "^4.0.0" proxy-from-env "^1.1.0" -axobject-query@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" - integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -3474,18 +3433,6 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-jest@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.3.tgz#c1187258197c099072156a0a121c11ee1e3917d5" @@ -4063,6 +4010,14 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +call-bind-apply-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.0.tgz#33127b42608972f76812a501d69db5d8ce404979" + integrity sha512-CCKAP2tkPau7D3GE8+V8R6sQubA9R5foIzGp+85EXCVSCivuxBNAWqcpn72PKYiIcqoViv/kcUDpaEIMBVi1lQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -4071,6 +4026,16 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7, call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -4539,21 +4504,11 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -confusing-browser-globals@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59" - integrity sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA== - console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= - content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" @@ -4666,11 +4621,6 @@ core-js-compat@^3.20.2, core-js-compat@^3.21.0, core-js-compat@^3.8.1: browserslist "^4.19.1" semver "7.0.0" -core-js-pure@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.9.1.tgz#677b322267172bd490e4464696f790cbc355bec5" - integrity sha512-laz3Zx0avrw9a4QEIdmIblnVuJz8W51leY9iLThatCsFawWxC3sE4guASC78JbCin+DkwMpCdp1AVAuzL/GN7A== - core-js@^2.4.0: version "2.6.12" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" @@ -4758,7 +4708,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -4767,6 +4717,15 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +cross-spawn@^7.0.5: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -4844,11 +4803,6 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== -damerau-levenshtein@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz#143c1641cb3d85c60c32329e26899adea8701791" - integrity sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug== - dargs@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" @@ -4871,6 +4825,33 @@ data-urls@^5.0.0: whatwg-mimetype "^4.0.0" whatwg-url "^14.0.0" +data-view-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" + integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" + integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-data-view "^1.0.1" + +data-view-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" + integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-data-view "^1.0.1" + date-fns@^2.30.0: version "2.30.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" @@ -4893,14 +4874,14 @@ de-indent@^1.0.2: resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" integrity sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg== -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: version "4.3.5" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== @@ -4914,6 +4895,20 @@ debug@4.3.4: dependencies: ms "2.1.2" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.3.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -4960,9 +4955,9 @@ deep-extend@^0.6.0: integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.0.0, deepmerge@^4.2.2: version "4.3.1" @@ -4976,6 +4971,15 @@ defaults@^1.0.3: 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" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -4989,6 +4993,15 @@ define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -5107,14 +5120,6 @@ dir-glob@^3.0.0, dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -doctrine@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -5122,14 +5127,7 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dom-accessibility-api@^0.5.4, dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9: +dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9: version "0.5.13" resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.13.tgz#102ee5f25eacce09bdf1cfa5a298f86da473be4b" integrity sha512-R305kwb5CcMDIpSHUnLyIAp7SrSPBx6F0VfQFB3M75xVMHhXJJIdePYgbPPh1o57vCHNu5QztokWUPsLjWzFqw== @@ -5220,6 +5218,15 @@ dotenv@^8.6.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +dunder-proto@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.0.tgz#c2fce098b3c8f8899554905f4377b6d85dabaa80" + integrity sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-errors "^1.3.0" + gopd "^1.2.0" + duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" @@ -5282,17 +5289,12 @@ emoji-regex@^10.3.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emoji-regex@^9.0.0, emoji-regex@^9.2.0: +emoji-regex@^9.2.0: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== @@ -5316,13 +5318,6 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - 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" @@ -5362,14 +5357,66 @@ err-code@^2.0.2: resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== -error-ex@^1.2.0, error-ex@^1.3.1: +error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.19.0, es-abstract@^1.20.4: +es-abstract@^1.17.5, es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2, es-abstract@^1.23.3, es-abstract@^1.23.5: + version "1.23.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.5.tgz#f4599a4946d57ed467515ed10e4f157289cd52fb" + integrity sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ== + dependencies: + array-buffer-byte-length "^1.0.1" + arraybuffer.prototype.slice "^1.0.3" + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + data-view-buffer "^1.0.1" + data-view-byte-length "^1.0.1" + data-view-byte-offset "^1.0.0" + es-define-property "^1.0.0" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + es-set-tostringtag "^2.0.3" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.4" + get-symbol-description "^1.0.2" + globalthis "^1.0.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + has-proto "^1.0.3" + has-symbols "^1.0.3" + hasown "^2.0.2" + internal-slot "^1.0.7" + is-array-buffer "^3.0.4" + is-callable "^1.2.7" + is-data-view "^1.0.1" + is-negative-zero "^2.0.3" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.3" + is-string "^1.0.7" + is-typed-array "^1.1.13" + is-weakref "^1.0.2" + object-inspect "^1.13.3" + object-keys "^1.1.1" + object.assign "^4.1.5" + regexp.prototype.flags "^1.5.3" + safe-array-concat "^1.1.2" + safe-regex-test "^1.0.3" + string.prototype.trim "^1.2.9" + string.prototype.trimend "^1.0.8" + string.prototype.trimstart "^1.0.8" + typed-array-buffer "^1.0.2" + typed-array-byte-length "^1.0.1" + typed-array-byte-offset "^1.0.2" + typed-array-length "^1.0.6" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.15" + +es-abstract@^1.19.0, es-abstract@^1.20.4: version "1.21.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.1.tgz#e6105a099967c08377830a0c9cb589d570dd86c6" integrity sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg== @@ -5413,6 +5460,44 @@ es-array-method-boxes-properly@^1.0.0: resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-define-property@^1.0.0, es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.2.1, es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-iterator-helpers@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.2.0.tgz#2f1a3ab998b30cb2d10b195b587c6d9ebdebf152" + integrity sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" + es-errors "^1.3.0" + es-set-tostringtag "^2.0.3" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + globalthis "^1.0.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + has-proto "^1.0.3" + has-symbols "^1.0.3" + internal-slot "^1.0.7" + iterator.prototype "^1.1.3" + safe-array-concat "^1.1.2" + +es-object-atoms@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" + integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== + dependencies: + es-errors "^1.3.0" + es-set-tostringtag@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" @@ -5422,6 +5507,22 @@ es-set-tostringtag@^2.0.1: has "^1.0.3" has-tostringtag "^1.0.0" +es-set-tostringtag@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" + integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== + dependencies: + get-intrinsic "^1.2.4" + has-tostringtag "^1.0.2" + hasown "^2.0.1" + +es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" + integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== + dependencies: + hasown "^2.0.0" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -5614,6 +5715,11 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escape-string-regexp@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" @@ -5630,333 +5736,167 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.2.1: - version "14.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e" - integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA== - dependencies: - confusing-browser-globals "^1.0.10" - object.assign "^4.1.2" - object.entries "^1.1.2" - -eslint-config-airbnb@^18.2.1: - version "18.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9" - integrity sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg== - dependencies: - eslint-config-airbnb-base "^14.2.1" - object.assign "^4.1.2" - object.entries "^1.1.2" - -eslint-config-prettier@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" - integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== - dependencies: - get-stdin "^6.0.0" - -eslint-config-react-app@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-6.0.0.tgz#ccff9fc8e36b322902844cbd79197982be355a0e" - integrity sha512-bpoAAC+YRfzq0dsTk+6v9aHm/uqnDwayNAXleMypGl6CpxI9oXXscVHo4fk3eJPIn+rsbtNetB4r/ZIidFIE8A== - dependencies: - confusing-browser-globals "^1.0.10" - -eslint-import-resolver-alias@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz#297062890e31e4d6651eb5eba9534e1f6e68fc97" - integrity sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w== - -eslint-import-resolver-babel-module@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-babel-module/-/eslint-import-resolver-babel-module-5.2.0.tgz#0d328bd8e5968daebcb4d705e0cfec0819a4c23f" - integrity sha512-BoVKAfaveJSzKGI1wIaomg/lEbE7Zr08+fDSCWccgYrE9wRQjCbtYIQsNRNYFCcwbFv48/y+Qa19FwOv0B5g5A== - dependencies: - pkg-up "^2.0.0" - resolve "^1.10.0" - -eslint-import-resolver-node@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" - integrity sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA== - dependencies: - debug "^2.6.9" - resolve "^1.13.1" - -eslint-module-utils@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6" - integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== +eslint-import-resolver-node@^0.3.9: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== dependencies: - debug "^2.6.9" - pkg-dir "^2.0.0" - -eslint-plugin-babel@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz#75a2413ffbf17e7be57458301c60291f2cfbf560" - integrity sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g== - dependencies: - eslint-rule-composer "^0.3.0" - -eslint-plugin-es@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" - integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== - dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" - -eslint-plugin-flowtype@^5.2.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.4.0.tgz#a559526e56403cb97b470b524957fc526e2485fe" - integrity sha512-O0s0iTT5UxYuoOpHMLSIO2qZMyvrb9shhk1EM5INNGtJ2CffrfUmsnh6TVsnoT41fkXIEndP630WNovhoO87xQ== - dependencies: - lodash "^4.17.15" - string-natural-compare "^3.0.1" - -eslint-plugin-import@^2.22.1: - version "2.22.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz#0896c7e6a0cf44109a2d97b95903c2bb689d7702" - integrity sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw== - dependencies: - array-includes "^3.1.1" - array.prototype.flat "^1.2.3" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.4" - eslint-module-utils "^2.6.0" - has "^1.0.3" - minimatch "^3.0.4" - object.values "^1.1.1" - read-pkg-up "^2.0.0" - resolve "^1.17.0" - tsconfig-paths "^3.9.0" + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz#fe4cfb948d61f49203d7b08871982b65b9af0b0b" + integrity sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.31.0: + version "2.31.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz#310ce7e720ca1d9c0bb3f69adfd1c6bdd7d9e0e7" + integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== + dependencies: + "@rtsao/scc" "^1.1.0" + array-includes "^3.1.8" + array.prototype.findlastindex "^1.2.5" + array.prototype.flat "^1.3.2" + array.prototype.flatmap "^1.3.2" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.9" + eslint-module-utils "^2.12.0" + hasown "^2.0.2" + is-core-module "^2.15.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.8" + object.groupby "^1.0.3" + object.values "^1.2.0" + semver "^6.3.1" + string.prototype.trimend "^1.0.8" + tsconfig-paths "^3.15.0" -eslint-plugin-jest-dom@^3.3.0: - version "3.6.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-3.6.5.tgz#61459d1db52873d438983d3aa84aaa9804eff222" - integrity sha512-iaJ5aSQghp9u2ciLAseWIVu7X5tW+WwNJwMBDToK4GBfwGXXQJDLt5IBNtm6fHvC3FRzCGwvyNMIG1g5gF+icQ== +eslint-plugin-jest-dom@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.5.0.tgz#3ccdfe197eddb4108f390db583057a5dacccd4a0" + integrity sha512-CRlXfchTr7EgC3tDI7MGHY6QjdJU5Vv2RPaeeGtkXUHnKZf04kgzMPIJUXt4qKCvYWVVIEo9ut9Oq1vgXAykEA== dependencies: - "@babel/runtime" "^7.9.6" - "@testing-library/dom" "^7.28.1" + "@babel/runtime" "^7.16.3" requireindex "^1.2.0" -eslint-plugin-jest@^24.1.3: - version "24.3.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.2.tgz#30a8b2dea6278d0da1d6fb9d6cd530aaf58050a1" - integrity sha512-cicWDr+RvTAOKS3Q/k03+Z3odt3VCiWamNUHWd6QWbVQWcYJyYgUTu8x0mx9GfeDEimawU5kQC+nQ3MFxIM6bw== - dependencies: - "@typescript-eslint/experimental-utils" "^4.0.1" - -eslint-plugin-jsx-a11y@^6.4.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd" - integrity sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg== - dependencies: - "@babel/runtime" "^7.11.2" - aria-query "^4.2.2" - array-includes "^3.1.1" - ast-types-flow "^0.0.7" - axe-core "^4.0.2" - axobject-query "^2.2.0" - damerau-levenshtein "^1.0.6" - emoji-regex "^9.0.0" - has "^1.0.3" - jsx-ast-utils "^3.1.0" - language-tags "^1.0.5" - -eslint-plugin-node@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" - integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== - dependencies: - eslint-plugin-es "^3.0.0" - eslint-utils "^2.0.0" - ignore "^5.1.1" - minimatch "^3.0.4" - resolve "^1.10.1" - semver "^6.1.0" - -eslint-plugin-prettier@^3.1.4: - version "3.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7" - integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ== +eslint-plugin-jest@^28.9.0: + version "28.9.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz#19168dfaed124339cd2252c4c4d1ac3688aeb243" + integrity sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ== dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-plugin-promise@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz#61485df2a359e03149fdafc0a68b0e030ad2ac45" - integrity sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ== + "@typescript-eslint/utils" "^6.0.0 || ^7.0.0 || ^8.0.0" -eslint-plugin-react-hooks@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556" - integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ== - -eslint-plugin-react@^7.21.5: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz#3d1c542d1d3169c45421c1215d9470e341707269" - integrity sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA== - dependencies: - array-includes "^3.1.1" - array.prototype.flatmap "^1.2.3" +eslint-plugin-react-hooks@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.1.0.tgz#3d34e37d5770866c34b87d5b499f5f0b53bf0854" + integrity sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw== + +eslint-plugin-react@^7.37.2: + version "7.37.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz#cd0935987876ba2900df2f58339f6d92305acc7a" + integrity sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w== + dependencies: + array-includes "^3.1.8" + array.prototype.findlast "^1.2.5" + array.prototype.flatmap "^1.3.2" + array.prototype.tosorted "^1.1.4" doctrine "^2.1.0" - has "^1.0.3" + es-iterator-helpers "^1.1.0" + estraverse "^5.3.0" + hasown "^2.0.2" jsx-ast-utils "^2.4.1 || ^3.0.0" - object.entries "^1.1.2" - object.fromentries "^2.0.2" - object.values "^1.1.1" - prop-types "^15.7.2" - resolve "^1.18.1" - string.prototype.matchall "^4.0.2" - -eslint-plugin-sort-destructure-keys@1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-sort-destructure-keys/-/eslint-plugin-sort-destructure-keys-1.3.5.tgz#c6f45c3e58d4435564025a6ca5f4a838010800fd" - integrity sha512-JmVpidhDsLwZsmRDV7Tf/vZgOAOEQGkLtwToSvX5mD8fuWYS/xkgMRBsalW1fGlc8CgJJwnzropt4oMQ7YCHLg== - dependencies: - natural-compare-lite "^1.4.0" - -eslint-plugin-sort-keys-fix@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-sort-keys-fix/-/eslint-plugin-sort-keys-fix-1.1.2.tgz#00c8b5791612ec32162b8d7a0563e9c6eb27ec59" - integrity sha512-DNPHFGCA0/hZIsfODbeLZqaGY/+q3vgtshF85r+YWDNCQ2apd9PNs/zL6ttKm0nD1IFwvxyg3YOTI7FHl4unrw== - dependencies: - espree "^6.1.2" - esutils "^2.0.2" - natural-compare "^1.4.0" - requireindex "~1.2.0" - -eslint-plugin-testing-library@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-6.2.0.tgz#af3340b783c881eb19ec5ac6b3a4bfe8ab4a1f74" - integrity sha512-+LCYJU81WF2yQ+Xu4A135CgK8IszcFcyMF4sWkbiu6Oj+Nel0TrkZq/HvDw0/1WuO3dhDQsZA/OpEMGd0NfcUw== - dependencies: - "@typescript-eslint/utils" "^5.58.0" - -eslint-plugin-typescript-sort-keys@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-2.1.0.tgz#f51764518aa512d83df9ba68ab2520b7b85ece2d" - integrity sha512-ET7ABypdz19m47QnKynzNfWPi4CTNQ5jQQC1X5d0gojIwblkbGiCa5IilsqzBTmqxZ0yXDqKBO/GBkBFQCOFsg== - dependencies: - "@typescript-eslint/experimental-utils" "^5.0.0" - json-schema "^0.4.0" - natural-compare-lite "^1.4.0" - -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" - integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + minimatch "^3.1.2" + object.entries "^1.1.8" + object.fromentries "^2.0.8" + object.values "^1.2.0" + prop-types "^15.8.1" + resolve "^2.0.0-next.5" + semver "^6.3.1" + string.prototype.matchall "^4.0.11" + string.prototype.repeat "^1.0.0" -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== +eslint-scope@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442" + integrity sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A== dependencies: esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.0.0, eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + estraverse "^5.2.0" -eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== +eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" + integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -eslint@7.14.0: - version "7.14.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.14.0.tgz#2d2cac1d28174c510a97b377f122a5507958e344" - integrity sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA== +eslint@^9.16.0: + version "9.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.16.0.tgz#66832e66258922ac0a626f803a9273e37747f2a6" + integrity sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA== dependencies: - "@babel/code-frame" "^7.0.0" - "@eslint/eslintrc" "^0.2.1" - ajv "^6.10.0" + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.12.1" + "@eslint/config-array" "^0.19.0" + "@eslint/core" "^0.9.0" + "@eslint/eslintrc" "^3.2.0" + "@eslint/js" "9.16.0" + "@eslint/plugin-kit" "^0.2.3" + "@humanfs/node" "^0.16.6" + "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.4.1" + "@types/estree" "^1.0.6" + "@types/json-schema" "^7.0.15" + ajv "^6.12.4" chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.0" - esquery "^1.2.0" + cross-spawn "^7.0.5" + debug "^4.3.2" + escape-string-regexp "^4.0.0" + eslint-scope "^8.2.0" + eslint-visitor-keys "^4.2.0" + espree "^10.3.0" + esquery "^1.5.0" esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" + fast-deep-equal "^3.1.3" + file-entry-cache "^8.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash "^4.17.19" - minimatch "^3.0.4" + lodash.merge "^4.6.2" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" + optionator "^0.9.3" -espree@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" - integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== - dependencies: - acorn "^7.1.1" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.1.0" - -espree@^7.3.0: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^10.0.1, espree@^10.3.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a" + integrity sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.14.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.2.0" esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== +esquery@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== dependencies: estraverse "^5.1.0" @@ -5967,12 +5907,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -6140,16 +6075,11 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - fast-fifo@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.1.0.tgz#17d1a3646880b9891dfa0c54e69c5fef33cad779" @@ -6166,6 +6096,17 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +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== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -6174,7 +6115,7 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-sta fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastest-levenshtein@^1.0.12: version "1.0.16" @@ -6209,12 +6150,12 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^2.0.1" + flat-cache "^4.0.0" file-selector@^0.6.0: version "0.6.0" @@ -6275,7 +6216,7 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-up@^2.0.0, find-up@^2.1.0: +find-up@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= @@ -6317,19 +6258,18 @@ fix-webm-duration@^1.0.5: resolved "https://registry.yarnpkg.com/fix-webm-duration/-/fix-webm-duration-1.0.5.tgz#da4558a92196a677302bfc54780b494dd5336a96" integrity sha512-b6oula3OfSknx0aWoLsxvp4DVIYbwsf+UAkr6EDAK3iuMYk/OSNKzmeSI61GXK0MmFTEuzle19BPvTxMIKjkZg== -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" + flatted "^3.2.9" + keyv "^4.5.4" -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== +flatted@^3.2.9: + version "3.3.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" + integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== flow-parser@^0.179.0: version "0.179.0" @@ -6513,12 +6453,17 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -6561,6 +6506,20 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has "^1.0.3" has-symbols "^1.0.3" +get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.5.tgz#dfe7dd1b30761b464fe51bf4bb00ac7c37b681e7" + integrity sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg== + dependencies: + call-bind-apply-helpers "^1.0.0" + dunder-proto "^1.0.0" + es-define-property "^1.0.1" + es-errors "^1.3.0" + function-bind "^1.1.2" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -6571,11 +6530,6 @@ get-port@^5.0.0: resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - get-stream@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -6594,6 +6548,15 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-symbol-description@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" + integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== + dependencies: + call-bind "^1.0.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -6630,13 +6593,20 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob-regex@^0.3.0: version "0.3.2" resolved "https://registry.yarnpkg.com/glob-regex/-/glob-regex-0.3.2.tgz#27348f2f60648ec32a4a53137090b9fb934f3425" @@ -6693,12 +6663,15 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + +globals@^15.13.0: + version "15.13.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.13.0.tgz#bbec719d69aafef188ecd67954aae76a696010fc" + integrity sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g== globals@^9.18.0: version "9.18.0" @@ -6712,7 +6685,15 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" -globby@^11.0.0, globby@^11.0.1, globby@^11.0.3, globby@^11.0.4, globby@^11.1.0: +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + +globby@^11.0.0, globby@^11.0.1, globby@^11.0.4: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -6736,6 +6717,11 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@4.2.10: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -6804,16 +6790,35 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-proto@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.2.0.tgz#5de5a6eabd95fdffd9818b43055e8065e39fe9d5" + integrity sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ== + dependencies: + dunder-proto "^1.0.0" + +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + has-tostringtag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" @@ -6821,6 +6826,13 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -6881,7 +6893,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hasown@^2.0.0: +hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== @@ -7185,16 +7197,16 @@ ignore-walk@^5.0.1: dependencies: minimatch "^5.0.1" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.1, ignore@^5.2.0: +ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== +ignore@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + import-fresh@^3.0.0, import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -7272,7 +7284,7 @@ inline-style-parser@0.1.1: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== -internal-slot@^1.0.3, internal-slot@^1.0.4: +internal-slot@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== @@ -7281,6 +7293,15 @@ internal-slot@^1.0.3, internal-slot@^1.0.4: has "^1.0.3" side-channel "^1.0.4" +internal-slot@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" + integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.0" + side-channel "^1.0.4" + into-stream@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-6.0.0.tgz#4bfc1244c0128224e18b8870e85b2de8e66c6702" @@ -7355,11 +7376,26 @@ is-array-buffer@^3.0.1: get-intrinsic "^1.1.3" is-typed-array "^1.1.10" +is-array-buffer@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" + integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-async-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" + integrity sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA== + dependencies: + has-tostringtag "^1.0.0" + is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -7418,6 +7454,13 @@ is-core-module@^2.13.0, is-core-module@^2.5.0, is-core-module@^2.8.1: dependencies: hasown "^2.0.0" +is-core-module@^2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" + integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== + dependencies: + hasown "^2.0.2" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -7432,7 +7475,14 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1: +is-data-view@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" + integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== + dependencies: + is-typed-array "^1.1.13" + +is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== @@ -7484,10 +7534,12 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== +is-finalizationregistry@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz#d74a7d0c5f3578e34a20729e69202e578d495dc2" + integrity sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA== + dependencies: + call-bind "^1.0.7" is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -7511,6 +7563,13 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== +is-generator-function@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -7535,6 +7594,11 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== +is-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" + integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== + is-negated-glob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" @@ -7545,6 +7609,11 @@ is-negative-zero@^2.0.2: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-negative-zero@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" + integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" @@ -7626,6 +7695,11 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" +is-set@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" + integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -7633,6 +7707,13 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" +is-shared-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" + integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== + dependencies: + call-bind "^1.0.7" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -7682,6 +7763,13 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" +is-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" + integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== + dependencies: + which-typed-array "^1.1.14" + is-unc-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" @@ -7699,6 +7787,11 @@ is-valid-glob@^1.0.0: resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" integrity sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA== +is-weakmap@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" + integrity sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w== + is-weakref@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -7706,6 +7799,14 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +is-weakset@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.3.tgz#e801519df8c0c43e12ff2834eead84ec9e624007" + integrity sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ== + dependencies: + call-bind "^1.0.7" + get-intrinsic "^1.2.4" + is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -7718,11 +7819,16 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -7809,6 +7915,17 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +iterator.prototype@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.3.tgz#016c2abe0be3bbdb8319852884f60908ac62bf9c" + integrity sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ== + dependencies: + define-properties "^1.2.1" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + reflect.getprototypeof "^1.0.4" + set-function-name "^2.0.1" + java-properties@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-1.0.2.tgz#ccd1fa73907438a5b5c38982269d0e771fe78211" @@ -8382,6 +8499,11 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -8402,11 +8524,6 @@ json-schema-traverse@^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-schema@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - 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" @@ -8427,7 +8544,7 @@ json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== -json5@^1.0.1: +json5@^1.0.1, json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== @@ -8470,13 +8587,15 @@ jsonwebtoken@~9.0.0: ms "^2.1.1" semver "^7.3.8" -"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.0.tgz#41108d2cec408c3453c1bbe8a4aae9e1e2bd8f82" - integrity sha512-EIsmt3O3ljsU6sot/J4E1zDRxfBNrhjyf/OKjlydwgEimQuznlM4Wv7U+ueONJMyEn1WRE0K8dhi3dVAXYT24Q== +"jsx-ast-utils@^2.4.1 || ^3.0.0": + version "3.3.5" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" + integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ== dependencies: - array-includes "^3.1.2" - object.assign "^4.1.2" + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + object.assign "^4.1.4" + object.values "^1.1.6" just-diff-apply@^5.2.0: version "5.5.0" @@ -8505,6 +8624,13 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" +keyv@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -8539,18 +8665,6 @@ kleur@^4.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== -language-subtag-registry@~0.3.2: - version "0.3.21" - resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz#04ac218bea46f04cb039084602c6da9e788dd45a" - integrity sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg== - -language-tags@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" - integrity sha1-0yHbxNowuovzAk4ED6XBRmH5GTo= - dependencies: - language-subtag-registry "~0.3.2" - lazystream@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.1.tgz#494c831062f1f9408251ec44db1cba29242a2638" @@ -8739,16 +8853,6 @@ listr2@8.0.1: rfdc "^1.3.0" wrap-ansi "^9.0.0" -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ== - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -8894,7 +8998,7 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: +lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9647,7 +9751,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -9661,6 +9765,13 @@ minimatch@^5.0.1, minimatch@^5.1.0: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -9759,13 +9870,6 @@ mkdirp-infer-owner@^2.0.0: infer-owner "^1.0.4" mkdirp "^1.0.3" -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -9822,7 +9926,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.2: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.2, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -9854,11 +9958,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -natural-compare-lite@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" - integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -9939,7 +10038,7 @@ nopt@^6.0.0: dependencies: abbrev "^1.0.0" -normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: +normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -10226,6 +10325,11 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-inspect@^1.13.1, object-inspect@^1.13.3: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== + object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -10238,7 +10342,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.2, object.assign@^4.1.4: +object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== @@ -10248,25 +10352,34 @@ object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.2, object.assign@ has-symbols "^1.0.3" object-keys "^1.1.1" -object.entries@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" - integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== +object.assign@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - has "^1.0.3" + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" -object.fromentries@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" - integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== +object.entries@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.8.tgz#bffe6f282e01f4d17807204a24f8edd823599c41" + integrity sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has "^1.0.3" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + +object.fromentries@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" + integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-object-atoms "^1.0.0" object.getownpropertydescriptors@^2.0.3: version "2.1.5" @@ -10278,6 +10391,15 @@ object.getownpropertydescriptors@^2.0.3: define-properties "^1.1.4" es-abstract "^1.20.4" +object.groupby@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" + integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -10285,15 +10407,14 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.3.tgz#eaa8b1e17589f02f698db093f7c62ee1699742ee" - integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw== +object.values@^1.1.6, object.values@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" + integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has "^1.0.3" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" on-finished@2.4.1: version "2.4.1" @@ -10337,17 +10458,17 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.4" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== dependencies: deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" + word-wrap "^1.2.5" ordered-read-streams@^1.0.0: version "1.0.1" @@ -10523,13 +10644,6 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ== - dependencies: - error-ex "^1.2.0" - parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -10628,13 +10742,6 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ== - dependencies: - pify "^2.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -10666,11 +10773,6 @@ pidtree@0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== - pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" @@ -10701,13 +10803,6 @@ pkg-conf@^2.1.0: find-up "^2.0.0" load-json-file "^4.0.0" -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -10722,13 +10817,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -10755,6 +10843,11 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + postcss-selector-parser@^6.0.10: version "6.0.11" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" @@ -10782,27 +10875,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== - -pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== - dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^17.0.1" +prettier@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== pretty-format@^27.0.2: version "27.4.0" @@ -10853,11 +10929,6 @@ process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - promise-all-reject-late@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz#f8ebf13483e5ca91ad809ccc2fcf25f26f8643c2" @@ -11252,14 +11323,6 @@ read-package-json@^5.0.0, read-package-json@^5.0.2: normalize-package-data "^4.0.0" npm-normalize-package-bin "^2.0.0" -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w== - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - read-pkg-up@^7.0.0, read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -11269,15 +11332,6 @@ read-pkg-up@^7.0.0, read-pkg-up@^7.0.1: read-pkg "^5.2.0" type-fest "^0.8.1" -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA== - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - read-pkg@^5.0.0, read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" @@ -11368,6 +11422,20 @@ redeyed@~2.1.0: dependencies: esprima "~4.0.0" +reflect.getprototypeof@^1.0.4, reflect.getprototypeof@^1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.8.tgz#c58afb17a4007b4d1118c07b92c23fca422c5d82" + integrity sha512-B5dj6usc5dkk8uFliwjwDHM8To5/QwdKz9JcBZ8Ic4G1f0YmeeJTtE/ZTdgRFPAfxZFiUaPhZ1Jcs4qeagItGQ== + dependencies: + call-bind "^1.0.8" + define-properties "^1.2.1" + dunder-proto "^1.0.0" + es-abstract "^1.23.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + gopd "^1.2.0" + which-builtin-type "^1.2.0" + regenerate-unicode-properties@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56" @@ -11410,7 +11478,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.3.1, regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== @@ -11419,10 +11487,15 @@ regexp.prototype.flags@^1.3.1, regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== +regexp.prototype.flags@^1.5.2, regexp.prototype.flags@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" + integrity sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-errors "^1.3.0" + set-function-name "^2.0.2" regexpu-core@^5.0.1: version "5.0.1" @@ -11548,7 +11621,7 @@ require-from-string@^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== -requireindex@^1.2.0, requireindex@~1.2.0: +requireindex@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== @@ -11604,7 +11677,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== -resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.22.0: +resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.0, 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== @@ -11613,6 +11686,15 @@ resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.1 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^2.0.0-next.5: + version "2.0.0-next.5" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" + integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + restore-cursor@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" @@ -11646,13 +11728,6 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.1.tgz#2b6d4df52dffe8bb346992a10ea9451f24373a8f" integrity sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg== -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rimraf@^2.5.4: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -11730,6 +11805,16 @@ sade@^1.7.3: dependencies: mri "^1.1.0" +safe-array-concat@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" + integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== + dependencies: + call-bind "^1.0.7" + get-intrinsic "^1.2.4" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -11749,6 +11834,15 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" +safe-regex-test@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" + integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-regex "^1.1.4" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -11852,16 +11946,21 @@ semver@7.5.4: dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: +semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== +semver@^7.6.0: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -11896,6 +11995,28 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +set-function-name@^2.0.1, set-function-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" @@ -11945,6 +12066,16 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" + signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -11979,15 +12110,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - slice-ansi@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" @@ -12292,11 +12414,6 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-natural-compare@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" - integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== - "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -12306,15 +12423,6 @@ string-natural-compare@^3.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.1.0.tgz#d994252935224729ea3719c49f7206dc9c46550a" @@ -12324,18 +12432,41 @@ string-width@^7.0.0: get-east-asian-width "^1.0.0" strip-ansi "^7.1.0" -string.prototype.matchall@^4.0.2: - version "4.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.4.tgz#608f255e93e072107f5de066f81a2dfb78cf6b29" - integrity sha512-pknFIWVachNcyqRfaQSeu/FUfpvJTe4uskUSZ9Wc1RijsPuzbZ8TyYT8WCNnntCjUEqQ3vUHMAfVj2+wLAisPQ== +string.prototype.matchall@^4.0.11: + version "4.0.11" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz#1092a72c59268d2abaad76582dccc687c0297e0a" + integrity sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.2" + es-errors "^1.3.0" + es-object-atoms "^1.0.0" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.7" + regexp.prototype.flags "^1.5.2" + set-function-name "^2.0.2" + side-channel "^1.0.6" + +string.prototype.repeat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz#e90872ee0308b29435aa26275f6e1b762daee01a" + integrity sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w== dependencies: - call-bind "^1.0.2" define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - has-symbols "^1.0.1" - internal-slot "^1.0.3" - regexp.prototype.flags "^1.3.1" - side-channel "^1.0.4" + es-abstract "^1.17.5" + +string.prototype.trim@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" + integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.0" + es-object-atoms "^1.0.0" string.prototype.trimend@^1.0.6: version "1.0.6" @@ -12346,6 +12477,15 @@ string.prototype.trimend@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimend@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" + integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + string.prototype.trimstart@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" @@ -12355,6 +12495,15 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimstart@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" + integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -12376,13 +12525,6 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -12424,7 +12566,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +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== @@ -12495,16 +12637,6 @@ symlink-or-copy@^1.1.8, symlink-or-copy@^1.2.0, symlink-or-copy@^1.3.1: resolved "https://registry.yarnpkg.com/symlink-or-copy/-/symlink-or-copy-1.3.1.tgz#9506dd64d8e98fa21dcbf4018d1eab23e77f71fe" integrity sha512-0K91MEXFpBUaywiwSSkmKjnGcasG/rVBXFLJz5DrgGabpYD6N+3yZrfD6uUIfpuTu65DZLHi7N8CizHc07BPZA== -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.13" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" @@ -12570,7 +12702,7 @@ text-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.4.0.tgz#a1cfcc50cf34da41bfd047cc744f804d1680ea34" integrity sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g== -text-table@^0.2.0, text-table@~0.2.0: +text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= @@ -12744,6 +12876,11 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g== +ts-api-utils@^1.3.0: + version "1.4.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" + integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw== + ts-essentials@^2.0.3: version "2.0.12" resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" @@ -12763,6 +12900,16 @@ ts-jest@^29.1.4: semver "^7.5.3" yargs-parser "^21.0.1" +tsconfig-paths@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" + integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tsconfig-paths@^3.9.0: version "3.9.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" @@ -12773,7 +12920,7 @@ tsconfig-paths@^3.9.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^1.8.1, tslib@^1.9.3: +tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -12783,13 +12930,6 @@ tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.6.2: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -12850,6 +12990,39 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typed-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" + integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-typed-array "^1.1.13" + +typed-array-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" + integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + +typed-array-byte-offset@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz#3fa9f22567700cc86aaf86a1e7176f74b59600f2" + integrity sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + reflect.getprototypeof "^1.0.6" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" @@ -12859,11 +13032,32 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" +typed-array-length@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.7.tgz#ee4deff984b64be1e118b0de8c9c877d5ce73d3d" + integrity sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + reflect.getprototypeof "^1.0.6" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typescript-eslint@^8.17.0: + version "8.17.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.17.0.tgz#fa4033c26b3b40f778287bc12918d985481b220b" + integrity sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA== + dependencies: + "@typescript-eslint/eslint-plugin" "8.17.0" + "@typescript-eslint/parser" "8.17.0" + "@typescript-eslint/utils" "8.17.0" + typescript@^4.2.4: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" @@ -13227,11 +13421,6 @@ uvu@^0.5.0: kleur "^4.0.3" sade "^1.7.3" -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - v8-to-istanbul@^9.0.1: version "9.2.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" @@ -13537,6 +13726,46 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-builtin-type@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/which-builtin-type/-/which-builtin-type-1.2.0.tgz#58042ac9602d78a6d117c7e811349df1268ba63c" + integrity sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA== + dependencies: + call-bind "^1.0.7" + function.prototype.name "^1.1.6" + has-tostringtag "^1.0.2" + is-async-function "^2.0.0" + is-date-object "^1.0.5" + is-finalizationregistry "^1.1.0" + is-generator-function "^1.0.10" + is-regex "^1.1.4" + is-weakref "^1.0.2" + isarray "^2.0.5" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.2" + which-typed-array "^1.1.15" + +which-collection@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" + integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== + dependencies: + is-map "^2.0.3" + is-set "^2.0.3" + is-weakmap "^2.0.2" + is-weakset "^2.0.3" + +which-typed-array@^1.1.14, which-typed-array@^1.1.15: + version "1.1.16" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.16.tgz#db4db429c4706feca2f01677a144278e4a8c216b" + integrity sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.2" + which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" @@ -13570,10 +13799,10 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" -word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +word-wrap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== wordwrap@^1.0.0: version "1.0.0" @@ -13611,13 +13840,6 @@ write-file-atomic@^4.0.0, write-file-atomic@^4.0.1, write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - ws@^7.5.10: version "7.5.10" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" From f74ddd13e3962a088bd8c9fe9c5994c13665fbed Mon Sep 17 00:00:00 2001 From: Anton Arnautov Date: Sat, 7 Dec 2024 18:25:41 +0100 Subject: [PATCH 2/3] Prettier changes only --- .releaserc.json | 8 +- .../version-11.x.x-sidebars.json | 2 +- docusaurus/react_versions.json | 5 +- e2e/user/Controller.ts | 5 +- e2e/user/components/Attachment/Attachment.ts | 2 +- examples/capacitor/src/App.tsx | 2 +- .../src/components/CustomMessage.tsx | 8 +- examples/capacitor/src/index.tsx | 2 +- examples/typescript/src/App.tsx | 4 +- .../src/components/CustomMessage.tsx | 8 +- examples/vite/src/App.tsx | 4 +- .../AIStateIndicator/AIStateIndicator.tsx | 9 +- .../AIStateIndicator/hooks/useAIState.ts | 2 +- src/components/Attachment/Attachment.tsx | 8 +- .../Attachment/AttachmentActions.tsx | 4 +- .../Attachment/AttachmentContainer.tsx | 32 +-- src/components/Attachment/Audio.tsx | 4 +- src/components/Attachment/FileAttachment.tsx | 4 +- .../Attachment/UnsupportedAttachment.tsx | 4 +- src/components/Attachment/VoiceRecording.tsx | 6 +- .../Attachment/__tests__/Attachment.test.js | 1 - .../__tests__/AttachmentActions.test.js | 1 - .../Attachment/__tests__/Audio.test.js | 2 +- src/components/Attachment/audioSampling.ts | 4 +- src/components/Attachment/utils.tsx | 34 +-- src/components/AutoCompleteTextarea/utils.js | 1 - src/components/Avatar/Avatar.tsx | 4 +- src/components/Avatar/ChannelAvatar.tsx | 4 +- .../Avatar/__tests__/Avatar.test.js | 2 +- src/components/Channel/Channel.tsx | 264 +++++++++--------- .../Channel/__tests__/Channel.test.js | 8 +- src/components/Channel/channelState.ts | 6 +- .../hooks/useChannelContainerClasses.ts | 4 +- .../hooks/useCreateChannelStateContext.ts | 2 +- .../Channel/hooks/useCreateTypingContext.ts | 2 +- .../Channel/hooks/useEditMessageHandler.ts | 4 +- .../Channel/hooks/useMentionsHandlers.ts | 4 +- src/components/Channel/utils.ts | 42 +-- .../ChannelHeader/ChannelHeader.tsx | 2 +- .../__tests__/ChannelHeader.test.js | 2 +- src/components/ChannelList/ChannelList.tsx | 11 +- .../ChannelList/ChannelListMessenger.tsx | 4 +- .../ChannelList/__tests__/ChannelList.test.js | 4 +- .../hooks/useChannelDeletedListener.ts | 2 +- .../hooks/useChannelHiddenListener.ts | 2 +- .../hooks/useChannelTruncatedListener.ts | 2 +- .../hooks/useChannelUpdatedListener.ts | 2 +- .../hooks/useChannelVisibleListener.ts | 2 +- .../hooks/useConnectionRecoveredListener.ts | 2 +- .../hooks/useMessageNewListener.ts | 2 +- .../useNotificationAddedToChannelListener.ts | 2 +- .../useNotificationMessageNewListener.ts | 2 +- ...eNotificationRemovedFromChannelListener.ts | 2 +- .../ChannelList/hooks/usePaginatedChannels.ts | 8 +- .../hooks/useUserPresenceChangedListener.ts | 2 +- src/components/ChannelList/utils.ts | 4 +- .../ChannelPreview/ChannelPreview.tsx | 6 +- .../ChannelPreviewMessenger.tsx | 2 +- .../__tests__/ChannelPreview.test.js | 1 - .../__tests__/ChannelPreviewMessenger.test.js | 1 - .../hooks/useChannelPreviewInfo.ts | 2 +- .../ChannelPreview/hooks/useIsChannelMuted.ts | 2 +- .../hooks/useMessageDeliveryStatus.ts | 4 +- src/components/ChannelPreview/utils.tsx | 16 +- .../ChannelSearch/ChannelSearch.tsx | 4 +- .../ChannelSearch/SearchResults.tsx | 20 +- .../ChannelSearch/__tests__/SearchBar.test.js | 2 +- .../ChannelSearch/hooks/useChannelSearch.ts | 13 +- src/components/ChannelSearch/utils.ts | 4 +- src/components/Chat/Chat.tsx | 4 +- src/components/Chat/hooks/useChat.ts | 4 +- .../Chat/hooks/useCreateChatContext.ts | 2 +- .../ChatAutoComplete/ChatAutoComplete.tsx | 82 +++--- .../__tests__/ChatAutocomplete.test.js | 1 - .../CommandItem/__tests__/CommandItem.test.js | 2 +- .../__tests__/DateSeparator.test.js | 2 +- src/components/Dialog/FormDialog.tsx | 2 +- .../DragAndDrop/DragAndDropContainer.tsx | 4 +- .../__tests__/EmoticonItem.test.js | 2 +- .../__tests__/EmptyStateIndicator.test.js | 2 +- .../EventComponent/EventComponent.tsx | 4 +- src/components/Gallery/Gallery.tsx | 9 +- src/components/Gallery/Image.tsx | 9 +- src/components/Gallery/ModalGallery.tsx | 4 +- .../Gallery/__tests__/Image.test.js | 2 - .../__tests__/InfiniteScroll.test.js | 2 +- .../Loading/LoadingErrorIndicator.tsx | 6 +- .../Loading/__tests__/LoadingChannels.test.js | 2 +- .../__tests__/LoadingErrorIndicator.test.js | 2 +- .../__tests__/LoadingIndicator.test.js | 2 +- src/components/MML/__tests__/MML.test.js | 2 +- .../__tests__/AudioRecorder.test.js | 7 +- .../classes/BrowserPermission.ts | 4 +- .../classes/MediaRecorderController.ts | 2 +- .../__tests__/AmplitudeRecorder.test.js | 1 - .../__tests__/MediaRecorderController.test.js | 5 +- .../MediaRecorder/hooks/useMediaRecorder.ts | 6 +- src/components/Message/FixedHeightMessage.tsx | 27 +- src/components/Message/Message.tsx | 18 +- src/components/Message/MessageDeleted.tsx | 4 +- .../Message/MessageEditedTimestamp.tsx | 9 +- src/components/Message/MessageErrorText.tsx | 4 +- src/components/Message/MessageOptions.tsx | 4 +- src/components/Message/MessageSimple.tsx | 14 +- src/components/Message/MessageStatus.tsx | 11 +- src/components/Message/MessageText.tsx | 19 +- src/components/Message/MessageTimestamp.tsx | 4 +- src/components/Message/QuotedMessage.tsx | 8 +- .../Message/StreamedMessageText.tsx | 9 +- .../Message/__tests__/Message.test.js | 1 - .../Message/__tests__/MessageDeleted.test.js | 1 - .../Message/__tests__/MessageOptions.test.js | 5 +- .../Message/__tests__/MessageSimple.test.js | 6 +- .../Message/__tests__/MessageText.test.js | 5 +- .../Message/hooks/useActionHandler.ts | 7 +- .../Message/hooks/useDeleteHandler.ts | 9 +- .../Message/hooks/useFlagHandler.ts | 4 +- .../Message/hooks/useMarkUnreadHandler.ts | 4 +- .../Message/hooks/useMentionsHandler.ts | 14 +- .../Message/hooks/useMessageTextStreaming.ts | 4 +- .../Message/hooks/useMuteHandler.ts | 4 +- .../Message/hooks/useOpenThreadHandler.ts | 7 +- src/components/Message/hooks/usePinHandler.ts | 4 +- .../Message/hooks/useReactionHandler.ts | 9 +- .../Message/hooks/useReactionsFetcher.ts | 6 +- .../Message/hooks/useRetryHandler.ts | 7 +- .../Message/hooks/useUserHandler.ts | 4 +- src/components/Message/hooks/useUserRole.ts | 7 +- src/components/Message/icons.tsx | 2 +- .../renderText/componentRenderers/Mention.tsx | 4 +- .../rehypePlugins/mentionsMarkdownPlugin.ts | 108 +++---- .../Message/renderText/renderText.tsx | 4 +- src/components/Message/types.ts | 6 +- .../CustomMessageActionsList.tsx | 4 +- .../MessageActions/MessageActions.tsx | 4 +- .../MessageActions/MessageActionsBox.tsx | 14 +- .../__tests__/MessageActionsBox.test.js | 4 +- .../MessageBounce/MessageBouncePrompt.tsx | 7 +- .../AttachmentPreviewList.tsx | 11 +- .../FileAttachmentPreview.tsx | 4 +- .../ImageAttachmentPreview.tsx | 4 +- .../UnsupportedAttachmentPreview.tsx | 4 +- .../VoiceRecordingPreview.tsx | 4 +- .../AttachmentPreviewList/types.ts | 2 +- .../MessageInput/AttachmentSelector.tsx | 10 +- .../MessageInput/DefaultTriggerProvider.tsx | 12 +- .../MessageInput/DropzoneProvider.tsx | 17 +- .../MessageInput/EditMessageForm.tsx | 2 +- src/components/MessageInput/MessageInput.tsx | 6 +- .../MessageInput/MessageInputFlat.tsx | 8 +- .../MessageInput/QuotedMessagePreview.tsx | 12 +- src/components/MessageInput/SendButton.tsx | 4 +- .../__tests__/AttachmentPreviewList.test.js | 2 - .../__tests__/LinkPreviewList.test.js | 101 +++---- .../__tests__/MessageInput.test.js | 122 ++++---- .../__tests__/useMessageInputState.test.js | 7 +- .../MessageInput/hooks/useAttachments.ts | 9 +- .../MessageInput/hooks/useCommandTrigger.ts | 4 +- .../MessageInput/hooks/useCooldownTimer.tsx | 7 +- .../hooks/useCreateMessageInputContext.ts | 2 +- .../MessageInput/hooks/useLinkPreviews.ts | 6 +- .../hooks/useMessageInputState.ts | 26 +- .../MessageInput/hooks/useMessageInputText.ts | 2 +- .../MessageInput/hooks/useSubmitHandler.ts | 13 +- .../MessageInput/hooks/useUserTrigger.ts | 4 +- src/components/MessageInput/hooks/utils.ts | 8 +- src/components/MessageInput/types.ts | 97 +++---- .../MessageList/ConnectionStatus.tsx | 2 +- .../MessageList/GiphyPreviewMessage.tsx | 4 +- src/components/MessageList/MessageList.tsx | 44 ++- .../MessageList/MessageListMainPanel.tsx | 3 +- .../MessageList/VirtualizedMessageList.tsx | 49 ++-- .../VirtualizedMessageListComponents.tsx | 17 +- .../__tests__/CustomNotification.test.js | 3 +- .../MessageList/__tests__/MessageList.test.js | 2 +- .../__tests__/MessageNotification.test.js | 2 +- .../__tests__/ScrollToBottomButton.test.js | 1 - .../hooks/MessageList/useEnrichedMessages.ts | 2 +- .../MessageList/useMessageListElements.tsx | 11 +- .../useMessageListScrollManager.ts | 4 +- .../MessageList/useScrollLocationLogic.tsx | 4 +- .../VirtualizedMessageList/useGiphyPreview.ts | 7 +- .../useMessageSetKey.ts | 4 +- .../useNewMessageNotification.ts | 2 +- .../usePrependMessagesCount.ts | 6 +- .../useScrollToBottomOnNewMessage.ts | 4 +- .../useShouldForceScrollToBottom.ts | 2 +- ...seUnreadMessagesNotificationVirtualized.ts | 2 +- .../MessageList/hooks/useLastReadData.ts | 4 +- .../MessageList/hooks/useMarkRead.ts | 4 +- src/components/MessageList/renderMessages.tsx | 8 +- src/components/MessageList/utils.ts | 28 +- src/components/Modal/Modal.tsx | 2 +- src/components/Modal/__tests__/Modal.test.js | 2 +- src/components/Poll/Poll.tsx | 8 +- .../Poll/PollActions/AddCommentForm.tsx | 4 +- .../Poll/PollActions/EndPollDialog.tsx | 2 +- .../Poll/PollActions/PollActions.tsx | 4 +- .../Poll/PollActions/PollAnswerList.tsx | 13 +- .../Poll/PollActions/PollOptionsFullList.tsx | 4 +- .../PollResults/PollOptionVotesList.tsx | 17 +- .../PollResults/PollOptionWithLatestVotes.tsx | 8 +- .../PollResults/PollOptionWithVotesHeader.tsx | 8 +- .../PollActions/PollResults/PollResults.tsx | 6 +- .../PollActions/SuggestPollOptionForm.tsx | 6 +- src/components/Poll/PollContent.tsx | 10 +- .../PollCreationDialog/OptionFieldSet.tsx | 2 +- .../PollCreationDialog/PollCreationDialog.tsx | 2 +- src/components/Poll/PollHeader.tsx | 6 +- src/components/Poll/PollOptionList.tsx | 11 +- src/components/Poll/PollOptionSelector.tsx | 15 +- src/components/Poll/PollVote.tsx | 10 +- src/components/Poll/QuotedPoll.tsx | 4 +- .../Poll/__tests__/PollCreationDialog.test.js | 8 +- .../Poll/hooks/useManagePollVotesRealtime.ts | 2 +- .../Poll/hooks/usePollAnswerPagination.ts | 4 +- .../hooks/usePollOptionVotesPagination.ts | 4 +- .../ReactFileUtilities/FileIcon/mimeTypes.ts | 10 +- .../ReactFileUtilities/UploadButton.tsx | 14 +- src/components/Reactions/ReactionSelector.tsx | 9 +- .../Reactions/ReactionSelectorWithButton.tsx | 2 +- src/components/Reactions/ReactionsList.tsx | 10 +- .../Reactions/ReactionsListModal.tsx | 20 +- .../Reactions/SimpleReactionsList.tsx | 9 +- .../Reactions/__tests__/ReactionsList.test.js | 1 - .../Reactions/hooks/useFetchReactions.ts | 9 +- .../Reactions/hooks/useProcessReactions.tsx | 12 +- src/components/Reactions/reactionOptions.tsx | 2 +- src/components/Reactions/types.ts | 4 +- src/components/Thread/Thread.tsx | 7 +- src/components/Thread/ThreadHead.tsx | 7 +- src/components/Thread/ThreadHeader.tsx | 4 +- src/components/Threads/icons.tsx | 1 - .../TypingIndicator/TypingIndicator.tsx | 2 +- .../UserItem/__tests__/UserItem.test.js | 2 +- src/components/Window/Window.tsx | 4 +- src/context/ChannelActionContext.tsx | 18 +- src/context/ChannelListContext.tsx | 10 +- src/context/ChannelStateContext.tsx | 16 +- src/context/ChatContext.tsx | 12 +- src/context/ComponentContext.tsx | 12 +- src/context/MessageBounceContext.tsx | 6 +- src/context/MessageContext.tsx | 14 +- src/context/MessageInputContext.tsx | 6 +- src/context/PollContext.tsx | 10 +- src/context/TypingContext.tsx | 10 +- .../MessageActions/MessageActions.tsx | 5 +- .../hooks/useBaseMessageActionSetFilter.ts | 12 +- src/i18n/__tests__/Streami18n.test.js | 7 +- src/i18n/utils.ts | 66 ++--- src/mock-builders/generator/attachment.js | 148 +++------- src/mock-builders/generator/channel.js | 4 +- src/mock-builders/index.js | 1 - src/mock-builders/utils.js | 1 - src/store/hooks/useStateStore.ts | 6 +- src/stories/add-message.stories.tsx | 1 - src/stories/edit-message.stories.tsx | 3 +- src/stories/hello.stories.tsx | 1 - src/stories/jump-to-message.stories.tsx | 1 - src/stories/mark-read.stories.tsx | 1 - .../message-status-readby-tooltip.stories.tsx | 1 - src/stories/pin-message.stories.tsx | 4 +- src/utils/getChannel.ts | 8 +- 263 files changed, 1188 insertions(+), 1434 deletions(-) diff --git a/.releaserc.json b/.releaserc.json index b6a2f33302..6122b357ac 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -72,9 +72,11 @@ } ], [ - "@semantic-release/exec", { - "prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build" - }], + "@semantic-release/exec", + { + "prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build" + } + ], [ "@semantic-release/changelog", { diff --git a/docusaurus/react_versioned_sidebars/version-11.x.x-sidebars.json b/docusaurus/react_versioned_sidebars/version-11.x.x-sidebars.json index dfa7e279c2..8f084dc97b 100644 --- a/docusaurus/react_versioned_sidebars/version-11.x.x-sidebars.json +++ b/docusaurus/react_versioned_sidebars/version-11.x.x-sidebars.json @@ -146,4 +146,4 @@ "troubleshooting/troubleshooting", "resources/resources" ] -} \ No newline at end of file +} diff --git a/docusaurus/react_versions.json b/docusaurus/react_versions.json index 68753b9d4c..554f0e4583 100644 --- a/docusaurus/react_versions.json +++ b/docusaurus/react_versions.json @@ -1,4 +1 @@ -[ - "11.x.x", - "11.x.x-legacy" -] +["11.x.x", "11.x.x-legacy"] diff --git a/e2e/user/Controller.ts b/e2e/user/Controller.ts index c15d526c46..27d2265cbb 100644 --- a/e2e/user/Controller.ts +++ b/e2e/user/Controller.ts @@ -3,7 +3,10 @@ import type { Page } from '@playwright/test'; import selectors from './selectors'; export class Controller { - constructor(private baseURL: string | undefined, private page: Page) {} + constructor( + private baseURL: string | undefined, + private page: Page, + ) {} async openStory(story: string, waitForPresence: string) { await Promise.all([ diff --git a/e2e/user/components/Attachment/Attachment.ts b/e2e/user/components/Attachment/Attachment.ts index f418b4c031..51d109a32e 100644 --- a/e2e/user/components/Attachment/Attachment.ts +++ b/e2e/user/components/Attachment/Attachment.ts @@ -2,7 +2,7 @@ import { expect, Page } from '@playwright/test'; const attachmentTypes = ['card', 'img', 'gallery', 'video', 'file', 'media'] as const; -type AttachmentType = typeof attachmentTypes[number]; +type AttachmentType = (typeof attachmentTypes)[number]; export function getAttachment(page: Page, type: AttachmentType) { return page.locator(`.str-chat__message-attachment--${type}`); diff --git a/examples/capacitor/src/App.tsx b/examples/capacitor/src/App.tsx index 10826cafd0..70efddf311 100644 --- a/examples/capacitor/src/App.tsx +++ b/examples/capacitor/src/App.tsx @@ -17,7 +17,7 @@ const apiKey = process.env.REACT_APP_STREAM_KEY as string; const userId = process.env.REACT_APP_USER_ID as string; const userToken = process.env.REACT_APP_USER_TOKEN as string; -const filters: ChannelFilters = { type: 'messaging', members: {$in: [userId]} }; +const filters: ChannelFilters = { type: 'messaging', members: { $in: [userId] } }; const options: ChannelOptions = { state: true, presence: true, limit: 10 }; const sort: ChannelSort = { last_message_at: -1, updated_at: -1 }; diff --git a/examples/capacitor/src/components/CustomMessage.tsx b/examples/capacitor/src/components/CustomMessage.tsx index b7dbfec548..5d6f3e715e 100644 --- a/examples/capacitor/src/components/CustomMessage.tsx +++ b/examples/capacitor/src/components/CustomMessage.tsx @@ -16,12 +16,8 @@ import { import './CustomMessage.scss'; export const CustomMessage = () => { - const { - showDetailedReactions, - isReactionEnabled, - message, - reactionSelectorRef, - } = useMessageContext(); + const { showDetailedReactions, isReactionEnabled, message, reactionSelectorRef } = + useMessageContext(); const messageWrapperRef = useRef(null); diff --git a/examples/capacitor/src/index.tsx b/examples/capacitor/src/index.tsx index e9d9d29a0b..ee44bb2556 100644 --- a/examples/capacitor/src/index.tsx +++ b/examples/capacitor/src/index.tsx @@ -7,7 +7,7 @@ import * as serviceWorker from './serviceWorker'; createRoot(document.getElementById('root')!).render( - + , ); // If you want your app to work offline and load faster, you can change diff --git a/examples/typescript/src/App.tsx b/examples/typescript/src/App.tsx index ee16cb3110..77dec5c641 100644 --- a/examples/typescript/src/App.tsx +++ b/examples/typescript/src/App.tsx @@ -11,9 +11,9 @@ import { Window, } from 'stream-chat-react'; -const params = (new Proxy(new URLSearchParams(window.location.search), { +const params = new Proxy(new URLSearchParams(window.location.search), { get: (searchParams, property) => searchParams.get(property as string), -}) as unknown) as Record; +}) as unknown as Record; const apiKey = process.env.REACT_APP_STREAM_KEY as string; const userId = params.uid || (process.env.REACT_APP_USER_ID as string); diff --git a/examples/typescript/src/components/CustomMessage.tsx b/examples/typescript/src/components/CustomMessage.tsx index b7dbfec548..5d6f3e715e 100644 --- a/examples/typescript/src/components/CustomMessage.tsx +++ b/examples/typescript/src/components/CustomMessage.tsx @@ -16,12 +16,8 @@ import { import './CustomMessage.scss'; export const CustomMessage = () => { - const { - showDetailedReactions, - isReactionEnabled, - message, - reactionSelectorRef, - } = useMessageContext(); + const { showDetailedReactions, isReactionEnabled, message, reactionSelectorRef } = + useMessageContext(); const messageWrapperRef = useRef(null); diff --git a/examples/vite/src/App.tsx b/examples/vite/src/App.tsx index ced37ffe8e..3c95f5178a 100644 --- a/examples/vite/src/App.tsx +++ b/examples/vite/src/App.tsx @@ -16,9 +16,9 @@ import { } from 'stream-chat-react'; import 'stream-chat-react/css/v2/index.css'; -const params = (new Proxy(new URLSearchParams(window.location.search), { +const params = new Proxy(new URLSearchParams(window.location.search), { get: (searchParams, property) => searchParams.get(property as string), -}) as unknown) as Record; +}) as unknown as Record; const parseUserIdFromToken = (token: string) => { const [, payload] = token.split('.'); diff --git a/src/components/AIStateIndicator/AIStateIndicator.tsx b/src/components/AIStateIndicator/AIStateIndicator.tsx index 2bbe572f1b..977bd240a0 100644 --- a/src/components/AIStateIndicator/AIStateIndicator.tsx +++ b/src/components/AIStateIndicator/AIStateIndicator.tsx @@ -8,20 +8,19 @@ import { useChannelStateContext, useTranslationContext } from '../../context'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type AIStateIndicatorProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { channel?: Channel; }; export const AIStateIndicator = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ channel: channelFromProps, }: AIStateIndicatorProps) => { const { t } = useTranslationContext(); - const { channel: channelFromContext } = useChannelStateContext( - 'AIStateIndicator', - ); + const { channel: channelFromContext } = + useChannelStateContext('AIStateIndicator'); const channel = channelFromProps || channelFromContext; const { aiState } = useAIState(channel); const allowedStates = { diff --git a/src/components/AIStateIndicator/hooks/useAIState.ts b/src/components/AIStateIndicator/hooks/useAIState.ts index 54e955a6f5..33d744fda8 100644 --- a/src/components/AIStateIndicator/hooks/useAIState.ts +++ b/src/components/AIStateIndicator/hooks/useAIState.ts @@ -18,7 +18,7 @@ export const AIStates = { * @returns {{ aiState: AIState }} The current AI state for the given channel. */ export const useAIState = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel?: Channel, ): { aiState: AIState } => { diff --git a/src/components/Attachment/Attachment.tsx b/src/components/Attachment/Attachment.tsx index f1c32c43a8..972e12ad5e 100644 --- a/src/components/Attachment/Attachment.tsx +++ b/src/components/Attachment/Attachment.tsx @@ -55,7 +55,7 @@ export const ATTACHMENT_GROUPS_ORDER = [ ] as const; export type AttachmentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/ attachments: StreamAttachment[]; @@ -87,7 +87,7 @@ export type AttachmentProps< * A component used for rendering message attachments. By default, the component supports: AttachmentActions, Audio, Card, File, Gallery, Image, and Video */ export const Attachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: AttachmentProps, ) => { @@ -107,7 +107,7 @@ export const Attachment = < }; const renderGroupedAttachments = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachments, ...rest @@ -169,7 +169,7 @@ const renderGroupedAttachments = < }; const getAttachmentType = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: AttachmentProps['attachments'][number], ): keyof typeof CONTAINER_MAP => { diff --git a/src/components/Attachment/AttachmentActions.tsx b/src/components/Attachment/AttachmentActions.tsx index 72fef69829..ec323edfb0 100644 --- a/src/components/Attachment/AttachmentActions.tsx +++ b/src/components/Attachment/AttachmentActions.tsx @@ -7,7 +7,7 @@ import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler' import type { DefaultStreamChatGenerics } from '../../types/types'; export type AttachmentActionsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Attachment & { /** A list of actions */ actions: Action[]; @@ -20,7 +20,7 @@ export type AttachmentActionsProps< }; const UnMemoizedAttachmentActions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: AttachmentActionsProps, ) => { diff --git a/src/components/Attachment/AttachmentContainer.tsx b/src/components/Attachment/AttachmentContainer.tsx index 94e73d179a..e66ad83ffc 100644 --- a/src/components/Attachment/AttachmentContainer.tsx +++ b/src/components/Attachment/AttachmentContainer.tsx @@ -30,13 +30,13 @@ import type { import type { Attachment } from 'stream-chat'; export type AttachmentContainerProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachment: Attachment | GalleryAttachment; componentType: AttachmentComponentType; }; export const AttachmentWithinContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, children, @@ -50,8 +50,8 @@ export const AttachmentWithinContainer = < componentType === 'card' && !attachment?.image_url && !attachment?.thumb_url ? 'no-image' : attachment?.actions?.length - ? 'actions' - : ''; + ? 'actions' + : ''; } const classNames = clsx( @@ -69,7 +69,7 @@ export const AttachmentWithinContainer = < }; export const AttachmentActionsContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ actionHandler, attachment, @@ -108,7 +108,7 @@ function getCssDimensionsVariables(url: string) { } export const GalleryContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, Gallery = DefaultGallery, @@ -150,7 +150,7 @@ export const GalleryContainer = < }; export const ImageContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: RenderAttachmentProps, ) => { @@ -194,7 +194,7 @@ export const ImageContainer = < }; export const CardContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: RenderAttachmentProps, ) => { @@ -220,7 +220,7 @@ export const CardContainer = < }; export const FileContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, File = DefaultFile, @@ -234,7 +234,7 @@ export const FileContainer = < ); }; export const AudioContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, Audio = DefaultAudio, @@ -247,7 +247,7 @@ export const AudioContainer = < ); export const VoiceRecordingContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, VoiceRecording = DefaultVoiceRecording, @@ -261,7 +261,7 @@ export const VoiceRecordingContainer = < ); export const MediaContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: RenderAttachmentProps, ) => { @@ -269,10 +269,8 @@ export const MediaContainer = < const componentType = 'media'; const { shouldGenerateVideoThumbnail, videoAttachmentSizeHandler } = useChannelStateContext(); const videoElement = useRef(null); - const [ - attachmentConfiguration, - setAttachmentConfiguration, - ] = useState(); + const [attachmentConfiguration, setAttachmentConfiguration] = + useState(); useLayoutEffect(() => { if (videoElement.current && videoAttachmentSizeHandler) { @@ -319,7 +317,7 @@ export const MediaContainer = < }; export const UnsupportedAttachmentContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, UnsupportedAttachment = DefaultUnsupportedAttachment, diff --git a/src/components/Attachment/Audio.tsx b/src/components/Attachment/Audio.tsx index baff2d7ef6..c9b76a1000 100644 --- a/src/components/Attachment/Audio.tsx +++ b/src/components/Attachment/Audio.tsx @@ -8,14 +8,14 @@ import { useAudioController } from './hooks/useAudioController'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type AudioProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { // fixme: rename og to attachment og: Attachment; }; const UnMemoizedAudio = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: AudioProps, ) => { diff --git a/src/components/Attachment/FileAttachment.tsx b/src/components/Attachment/FileAttachment.tsx index 0e66e74a73..40acc537f0 100644 --- a/src/components/Attachment/FileAttachment.tsx +++ b/src/components/Attachment/FileAttachment.tsx @@ -7,13 +7,13 @@ import { DownloadButton, FileSizeIndicator } from './components'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type FileAttachmentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachment: Attachment; }; const UnMemoizedFileAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, }: FileAttachmentProps) => ( diff --git a/src/components/Attachment/UnsupportedAttachment.tsx b/src/components/Attachment/UnsupportedAttachment.tsx index e738ec8fed..6071ba5007 100644 --- a/src/components/Attachment/UnsupportedAttachment.tsx +++ b/src/components/Attachment/UnsupportedAttachment.tsx @@ -5,13 +5,13 @@ import type { Attachment } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type UnsupportedAttachmentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachment: Attachment; }; export const UnsupportedAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, }: UnsupportedAttachmentProps) => { diff --git a/src/components/Attachment/VoiceRecording.tsx b/src/components/Attachment/VoiceRecording.tsx index 2b1d62fe6a..c8ed2d7db8 100644 --- a/src/components/Attachment/VoiceRecording.tsx +++ b/src/components/Attachment/VoiceRecording.tsx @@ -12,7 +12,7 @@ import type { DefaultStreamChatGenerics } from '../../types'; const rootClassName = 'str-chat__message-attachment__voice-recording-widget'; export type VoiceRecordingPlayerProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'attachment'> & { /** An array of fractional numeric values of playback speed to override the defaults (1.0, 1.5, 2.0) */ playbackRates?: number[]; @@ -86,7 +86,7 @@ export const VoiceRecordingPlayer = ({ attachment, playbackRates }: VoiceRecordi }; export type QuotedVoiceRecordingProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'attachment'>; export const QuotedVoiceRecording = ({ attachment }: QuotedVoiceRecordingProps) => { @@ -120,7 +120,7 @@ export const QuotedVoiceRecording = ({ attachment }: QuotedVoiceRecordingProps) }; export type VoiceRecordingProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** The attachment object from the message's attachment list. */ attachment: Attachment; diff --git a/src/components/Attachment/__tests__/Attachment.test.js b/src/components/Attachment/__tests__/Attachment.test.js index 24dcb6ceec..e7c218289f 100644 --- a/src/components/Attachment/__tests__/Attachment.test.js +++ b/src/components/Attachment/__tests__/Attachment.test.js @@ -213,7 +213,6 @@ describe('attachment', () => { ], }); await waitFor(() => { - const Card = queryAllByTestId('card-attachment'); expect(Card).toHaveLength(3); diff --git a/src/components/Attachment/__tests__/AttachmentActions.test.js b/src/components/Attachment/__tests__/AttachmentActions.test.js index f7a514de43..d11e989cb4 100644 --- a/src/components/Attachment/__tests__/AttachmentActions.test.js +++ b/src/components/Attachment/__tests__/AttachmentActions.test.js @@ -51,7 +51,6 @@ describe('AttachmentActions', () => { fireEvent.click(getByTestId(actions[1].name)); await waitFor(() => { - expect(actionHandler).toHaveBeenCalledTimes(2); }); }); diff --git a/src/components/Attachment/__tests__/Audio.test.js b/src/components/Attachment/__tests__/Audio.test.js index ff53883253..c263b326d9 100644 --- a/src/components/Attachment/__tests__/Audio.test.js +++ b/src/components/Attachment/__tests__/Audio.test.js @@ -15,7 +15,7 @@ const originalConsoleError = console.error; jest.spyOn(console, 'error').mockImplementationOnce((...errorOrTextorArg) => { const msg = Array.isArray(errorOrTextorArg) ? errorOrTextorArg[0] - : errorOrTextorArg.message ?? errorOrTextorArg; + : (errorOrTextorArg.message ?? errorOrTextorArg); if (msg.match('Not implemented')) return; originalConsoleError(...errorOrTextorArg); }); diff --git a/src/components/Attachment/audioSampling.ts b/src/components/Attachment/audioSampling.ts index ff8b7638d8..289a491570 100644 --- a/src/components/Attachment/audioSampling.ts +++ b/src/components/Attachment/audioSampling.ts @@ -4,8 +4,8 @@ export const resampleWaveformData = (waveformData: number[], amplitudesCount: nu waveformData.length === amplitudesCount ? waveformData : waveformData.length > amplitudesCount - ? downSample(waveformData, amplitudesCount) - : upSample(waveformData, amplitudesCount); + ? downSample(waveformData, amplitudesCount) + : upSample(waveformData, amplitudesCount); /** * The downSample function uses the Largest-Triangle-Three-Buckets (LTTB) algorithm. diff --git a/src/components/Attachment/utils.tsx b/src/components/Attachment/utils.tsx index 26c8696dca..2160b7bd6b 100644 --- a/src/components/Attachment/utils.tsx +++ b/src/components/Attachment/utils.tsx @@ -15,89 +15,89 @@ import type { export const SUPPORTED_VIDEO_FORMATS = ['video/mp4', 'video/ogg', 'video/webm', 'video/quicktime']; -export type AttachmentComponentType = typeof ATTACHMENT_GROUPS_ORDER[number]; +export type AttachmentComponentType = (typeof ATTACHMENT_GROUPS_ORDER)[number]; export type GroupedRenderedAttachment = Record; export type GalleryAttachment< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { images: Attachment[]; type: 'gallery'; }; export type RenderAttachmentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, 'attachments'> & { attachment: Attachment; }; export type RenderGalleryProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, 'attachments'> & { attachment: GalleryAttachment; }; export const isLocalAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: UnknownType, ): attachment is LocalAttachment => !!(attachment.localMetadata as LocalAttachment)?.id; export const isScrapedContent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment, ) => attachment.og_scrape_url || attachment.title_link; export const isUploadedImage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment, ) => attachment.type === 'image' && !isScrapedContent(attachment); export const isLocalImageAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is LocalImageAttachment => isUploadedImage(attachment) && isLocalAttachment(attachment); export const isGalleryAttachmentType = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( output: Attachment | GalleryAttachment, ): output is GalleryAttachment => Array.isArray(output.images); export const isAudioAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ) => attachment.type === 'audio'; export const isLocalAudioAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is LocalAudioAttachment => isAudioAttachment(attachment) && isLocalAttachment(attachment); export const isVoiceRecordingAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is VoiceRecordingAttachment => attachment.type === 'voiceRecording'; export const isLocalVoiceRecordingAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is LocalVoiceRecordingAttachment => isVoiceRecordingAttachment(attachment) && isLocalAttachment(attachment); export const isFileAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ) => @@ -109,14 +109,14 @@ export const isFileAttachment = < ); export const isLocalFileAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is LocalFileAttachment => isFileAttachment(attachment) && isLocalAttachment(attachment); export const isMediaAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ) => @@ -124,7 +124,7 @@ export const isMediaAttachment = < attachment.type === 'video'; export const isLocalMediaAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): attachment is LocalVideoAttachment => diff --git a/src/components/AutoCompleteTextarea/utils.js b/src/components/AutoCompleteTextarea/utils.js index e1f37172a6..7b01d63105 100644 --- a/src/components/AutoCompleteTextarea/utils.js +++ b/src/components/AutoCompleteTextarea/utils.js @@ -17,7 +17,6 @@ export function defaultScrollToItem(container, item) { return; } - container.scrollTop = itemOffsetTop; } diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx index 4c8ab20059..d5381b7fbf 100644 --- a/src/components/Avatar/Avatar.tsx +++ b/src/components/Avatar/Avatar.tsx @@ -9,7 +9,7 @@ import { getWholeChar } from '../../utils'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type AvatarProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Custom root element class that will be merged with the default class */ className?: string; @@ -29,7 +29,7 @@ export type AvatarProps< * A round avatar image with fallback to username's first letter */ export const Avatar = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: AvatarProps, ) => { diff --git a/src/components/Avatar/ChannelAvatar.tsx b/src/components/Avatar/ChannelAvatar.tsx index eab6b088f9..6a9bd86ad4 100644 --- a/src/components/Avatar/ChannelAvatar.tsx +++ b/src/components/Avatar/ChannelAvatar.tsx @@ -3,11 +3,11 @@ import { Avatar, AvatarProps, GroupAvatar, GroupAvatarProps } from './index'; import type { DefaultStreamChatGenerics } from '../../types'; export type ChannelAvatarProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial & AvatarProps; export const ChannelAvatar = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ groupChannelDisplayInfo, image, diff --git a/src/components/Avatar/__tests__/Avatar.test.js b/src/components/Avatar/__tests__/Avatar.test.js index 3f362bb26f..6ebe5393fb 100644 --- a/src/components/Avatar/__tests__/Avatar.test.js +++ b/src/components/Avatar/__tests__/Avatar.test.js @@ -9,7 +9,7 @@ const AVATAR_ROOT_TEST_ID = 'avatar'; const AVATAR_FALLBACK_TEST_ID = 'avatar-fallback'; const AVATAR_IMG_TEST_ID = 'avatar-img'; -afterEach(cleanup); +afterEach(cleanup); describe('Avatar', () => { it('should render component with default props', () => { diff --git a/src/components/Channel/Channel.tsx b/src/components/Channel/Channel.tsx index 15512829a0..539476f854 100644 --- a/src/components/Channel/Channel.tsx +++ b/src/components/Channel/Channel.tsx @@ -100,7 +100,7 @@ import { useThreadContext } from '../Threads'; import { CHANNEL_CONTAINER_ID } from './constants'; type ChannelPropsForwardedToComponentContext< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick< ComponentContextValue, | 'Attachment' @@ -166,7 +166,7 @@ type ChannelPropsForwardedToComponentContext< >; const isUserResponseArray = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( output: string[] | UserResponse[], ): output is UserResponse[] => @@ -174,7 +174,7 @@ const isUserResponseArray = < export type ChannelProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = ChannelPropsForwardedToComponentContext & { /** List of accepted file types */ acceptedFiles?: string[]; @@ -255,7 +255,7 @@ export type ChannelProps< }; const ChannelContainer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, className: additionalClassName, @@ -275,7 +275,7 @@ const ChannelContainer = < const UnMemoizedChannel = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: PropsWithChildren>, ) => { @@ -286,9 +286,8 @@ const UnMemoizedChannel = < LoadingIndicator = DefaultLoadingIndicator, } = props; - const { channel: contextChannel, channelsQueryState } = useChatContext( - 'Channel', - ); + const { channel: contextChannel, channelsQueryState } = + useChatContext('Channel'); const channel = propsChannel || contextChannel; @@ -317,7 +316,7 @@ const UnMemoizedChannel = < const ChannelInner = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: PropsWithChildren< ChannelProps & { @@ -360,12 +359,8 @@ const ChannelInner = < [propChannelQueryOptions], ); - const { - client, - customClasses, - latestMessageDatesByChannels, - mutes, - } = useChatContext('Channel'); + const { client, customClasses, latestMessageDatesByChannels, mutes } = + useChatContext('Channel'); const { t } = useTranslationContext('Channel'); const chatContainerClass = getChatContainerClass(customClasses?.chatContainer); const windowsEmojiClass = useImageFlagEmojisOnWindowsClass(); @@ -586,7 +581,6 @@ const ChannelInner = < }); if (client.user?.id && channel.state.read[client.user.id]) { - const { user, ...ownReadState } = channel.state.read[client.user.id]; _setChannelUnreadUiState(ownReadState); } @@ -750,140 +744,142 @@ const ChannelInner = < [channel, loadMoreFinished], ); - const jumpToLatestMessage: ChannelActionContextValue['jumpToLatestMessage'] = useCallback(async () => { - await channel.state.loadMessageIntoState('latest'); - loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); - dispatch({ - type: 'jumpToLatestMessage', - }); - }, [channel, loadMoreFinished]); + const jumpToLatestMessage: ChannelActionContextValue['jumpToLatestMessage'] = + useCallback(async () => { + await channel.state.loadMessageIntoState('latest'); + loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); + dispatch({ + type: 'jumpToLatestMessage', + }); + }, [channel, loadMoreFinished]); - const jumpToFirstUnreadMessage: ChannelActionContextValue['jumpToFirstUnreadMessage'] = useCallback( - async ( - queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, - highlightDuration = DEFAULT_HIGHLIGHT_DURATION, - ) => { - if (!channelUnreadUiState?.unread_messages) return; - let lastReadMessageId = channelUnreadUiState?.last_read_message_id; - let firstUnreadMessageId = channelUnreadUiState?.first_unread_message_id; - let isInCurrentMessageSet = false; - - if (firstUnreadMessageId) { - const result = findInMsgSetById(firstUnreadMessageId, channel.state.messages); - isInCurrentMessageSet = result.index !== -1; - } else if (lastReadMessageId) { - const result = findInMsgSetById(lastReadMessageId, channel.state.messages); - isInCurrentMessageSet = !!result.target; - firstUnreadMessageId = - result.index > -1 ? channel.state.messages[result.index + 1]?.id : undefined; - } else { - const lastReadTimestamp = channelUnreadUiState.last_read.getTime(); - const { index: lastReadMessageIndex, target: lastReadMessage } = findInMsgSetByDate( - channelUnreadUiState.last_read, - channel.state.messages, - true, - ); - - if (lastReadMessage) { - firstUnreadMessageId = channel.state.messages[lastReadMessageIndex + 1]?.id; - isInCurrentMessageSet = !!firstUnreadMessageId; - lastReadMessageId = lastReadMessage.id; + const jumpToFirstUnreadMessage: ChannelActionContextValue['jumpToFirstUnreadMessage'] = + useCallback( + async ( + queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, + highlightDuration = DEFAULT_HIGHLIGHT_DURATION, + ) => { + if (!channelUnreadUiState?.unread_messages) return; + let lastReadMessageId = channelUnreadUiState?.last_read_message_id; + let firstUnreadMessageId = channelUnreadUiState?.first_unread_message_id; + let isInCurrentMessageSet = false; + + if (firstUnreadMessageId) { + const result = findInMsgSetById(firstUnreadMessageId, channel.state.messages); + isInCurrentMessageSet = result.index !== -1; + } else if (lastReadMessageId) { + const result = findInMsgSetById(lastReadMessageId, channel.state.messages); + isInCurrentMessageSet = !!result.target; + firstUnreadMessageId = + result.index > -1 ? channel.state.messages[result.index + 1]?.id : undefined; } else { - dispatch({ loadingMore: true, type: 'setLoadingMore' }); - let messages; - try { - messages = ( - await channel.query( - { - messages: { - created_at_around: channelUnreadUiState.last_read.toISOString(), - limit: queryMessageLimit, + const lastReadTimestamp = channelUnreadUiState.last_read.getTime(); + const { index: lastReadMessageIndex, target: lastReadMessage } = findInMsgSetByDate( + channelUnreadUiState.last_read, + channel.state.messages, + true, + ); + + if (lastReadMessage) { + firstUnreadMessageId = channel.state.messages[lastReadMessageIndex + 1]?.id; + isInCurrentMessageSet = !!firstUnreadMessageId; + lastReadMessageId = lastReadMessage.id; + } else { + dispatch({ loadingMore: true, type: 'setLoadingMore' }); + let messages; + try { + messages = ( + await channel.query( + { + messages: { + created_at_around: channelUnreadUiState.last_read.toISOString(), + limit: queryMessageLimit, + }, }, - }, - 'new', - ) - ).messages; - } catch (e) { - addNotification(t('Failed to jump to the first unread message'), 'error'); + 'new', + ) + ).messages; + } catch (e) { + addNotification(t('Failed to jump to the first unread message'), 'error'); + loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); + return; + } + + const firstMessageWithCreationDate = messages.find((msg) => msg.created_at); + if (!firstMessageWithCreationDate) { + addNotification(t('Failed to jump to the first unread message'), 'error'); + loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); + return; + } + const firstMessageTimestamp = new Date( + firstMessageWithCreationDate.created_at as string, + ).getTime(); + if (lastReadTimestamp < firstMessageTimestamp) { + // whole channel is unread + firstUnreadMessageId = firstMessageWithCreationDate.id; + } else { + const result = findInMsgSetByDate(channelUnreadUiState.last_read, messages); + lastReadMessageId = result.target?.id; + } loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); - return; } + } - const firstMessageWithCreationDate = messages.find((msg) => msg.created_at); - if (!firstMessageWithCreationDate) { + if (!firstUnreadMessageId && !lastReadMessageId) { + addNotification(t('Failed to jump to the first unread message'), 'error'); + return; + } + + if (!isInCurrentMessageSet) { + dispatch({ loadingMore: true, type: 'setLoadingMore' }); + try { + const targetId = (firstUnreadMessageId ?? lastReadMessageId) as string; + await channel.state.loadMessageIntoState(targetId, undefined, queryMessageLimit); + /** + * if the index of the last read message on the page is beyond the half of the page, + * we have arrived to the oldest page of the channel + */ + const indexOfTarget = channel.state.messages.findIndex( + (message) => message.id === targetId, + ) as number; + loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); + firstUnreadMessageId = + firstUnreadMessageId ?? channel.state.messages[indexOfTarget + 1]?.id; + } catch (e) { addNotification(t('Failed to jump to the first unread message'), 'error'); loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); return; } - const firstMessageTimestamp = new Date( - firstMessageWithCreationDate.created_at as string, - ).getTime(); - if (lastReadTimestamp < firstMessageTimestamp) { - // whole channel is unread - firstUnreadMessageId = firstMessageWithCreationDate.id; - } else { - const result = findInMsgSetByDate(channelUnreadUiState.last_read, messages); - lastReadMessageId = result.target?.id; - } - loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); } - } - if (!firstUnreadMessageId && !lastReadMessageId) { - addNotification(t('Failed to jump to the first unread message'), 'error'); - return; - } - - if (!isInCurrentMessageSet) { - dispatch({ loadingMore: true, type: 'setLoadingMore' }); - try { - const targetId = (firstUnreadMessageId ?? lastReadMessageId) as string; - await channel.state.loadMessageIntoState(targetId, undefined, queryMessageLimit); - /** - * if the index of the last read message on the page is beyond the half of the page, - * we have arrived to the oldest page of the channel - */ - const indexOfTarget = channel.state.messages.findIndex( - (message) => message.id === targetId, - ) as number; - loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); - firstUnreadMessageId = - firstUnreadMessageId ?? channel.state.messages[indexOfTarget + 1]?.id; - } catch (e) { + if (!firstUnreadMessageId) { addNotification(t('Failed to jump to the first unread message'), 'error'); - loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages); return; } - } + if (!channelUnreadUiState.first_unread_message_id) + _setChannelUnreadUiState({ + ...channelUnreadUiState, + first_unread_message_id: firstUnreadMessageId, + last_read_message_id: lastReadMessageId, + }); - if (!firstUnreadMessageId) { - addNotification(t('Failed to jump to the first unread message'), 'error'); - return; - } - if (!channelUnreadUiState.first_unread_message_id) - _setChannelUnreadUiState({ - ...channelUnreadUiState, - first_unread_message_id: firstUnreadMessageId, - last_read_message_id: lastReadMessageId, + dispatch({ + hasMoreNewer: channel.state.messagePagination.hasNext, + highlightedMessageId: firstUnreadMessageId, + type: 'jumpToMessageFinished', }); - dispatch({ - hasMoreNewer: channel.state.messagePagination.hasNext, - highlightedMessageId: firstUnreadMessageId, - type: 'jumpToMessageFinished', - }); - - if (clearHighlightedMessageTimeoutId.current) { - clearTimeout(clearHighlightedMessageTimeoutId.current); - } + if (clearHighlightedMessageTimeoutId.current) { + clearTimeout(clearHighlightedMessageTimeoutId.current); + } - clearHighlightedMessageTimeoutId.current = setTimeout(() => { - clearHighlightedMessageTimeoutId.current = null; - dispatch({ type: 'clearHighlightedMessage' }); - }, highlightDuration); - }, - [addNotification, channel, loadMoreFinished, t, channelUnreadUiState], - ); + clearHighlightedMessageTimeoutId.current = setTimeout(() => { + clearHighlightedMessageTimeoutId.current = null; + dispatch({ type: 'clearHighlightedMessage' }); + }, highlightDuration); + }, + [addNotification, channel, loadMoreFinished, t, channelUnreadUiState], + ); const deleteMessage = useCallback( async ( @@ -979,9 +975,9 @@ const ChannelInner = < } catch (error) { // error response isn't usable so needs to be stringified then parsed const stringError = JSON.stringify(error); - const parsedError = (stringError - ? JSON.parse(stringError) - : {}) as ErrorFromResponse; + const parsedError = ( + stringError ? JSON.parse(stringError) : {} + ) as ErrorFromResponse; // Handle the case where the message already exists // (typically, when retrying to send a message). diff --git a/src/components/Channel/__tests__/Channel.test.js b/src/components/Channel/__tests__/Channel.test.js index 298a0f4fc3..68f2a23867 100644 --- a/src/components/Channel/__tests__/Channel.test.js +++ b/src/components/Channel/__tests__/Channel.test.js @@ -1935,9 +1935,11 @@ describe('Channel', () => { name: 'MessageList', }, { - callback: (message) => ({ openThread, thread }) => { - if (!thread) openThread(message, { preventDefault: () => null }); - }, + callback: + (message) => + ({ openThread, thread }) => { + if (!thread) openThread(message, { preventDefault: () => null }); + }, component: Thread, getFirstMessageAvatar: () => { // the first avatar is that of the ThreadHeader diff --git a/src/components/Channel/channelState.ts b/src/components/Channel/channelState.ts index 98bf486653..7e34924505 100644 --- a/src/components/Channel/channelState.ts +++ b/src/components/Channel/channelState.ts @@ -6,7 +6,7 @@ import type { ChannelState, StreamMessage } from '../../context/ChannelStateCont import type { DefaultStreamChatGenerics } from '../../types/types'; export type ChannelStateReducerAction< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = | { type: 'closeThread'; @@ -86,11 +86,11 @@ export type ChannelStateReducerAction< }; export type ChannelStateReducer< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Reducer, ChannelStateReducerAction>; export const channelReducer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( state: ChannelState, action: ChannelStateReducerAction, diff --git a/src/components/Channel/hooks/useChannelContainerClasses.ts b/src/components/Channel/hooks/useChannelContainerClasses.ts index f3d8477350..ecaed31ea0 100644 --- a/src/components/Channel/hooks/useChannelContainerClasses.ts +++ b/src/components/Channel/hooks/useChannelContainerClasses.ts @@ -4,7 +4,7 @@ import { useChatContext } from '../../../context/ChatContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useImageFlagEmojisOnWindowsClass = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { useImageFlagEmojisOnWindows } = useChatContext('Channel'); return useImageFlagEmojisOnWindows && navigator.userAgent.match(/Win/) @@ -15,7 +15,7 @@ export const useImageFlagEmojisOnWindowsClass = < export const getChatContainerClass = (customClass?: string) => customClass ?? 'str-chat__container'; export const useChannelContainerClasses = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ customClasses, }: Pick) => { diff --git a/src/components/Channel/hooks/useCreateChannelStateContext.ts b/src/components/Channel/hooks/useCreateChannelStateContext.ts index 114b95cf34..c3a715fee5 100644 --- a/src/components/Channel/hooks/useCreateChannelStateContext.ts +++ b/src/components/Channel/hooks/useCreateChannelStateContext.ts @@ -7,7 +7,7 @@ import type { ChannelStateContextValue } from '../../../context/ChannelStateCont import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useCreateChannelStateContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( value: Omit, 'channelCapabilities'> & { channelCapabilitiesArray: string[]; diff --git a/src/components/Channel/hooks/useCreateTypingContext.ts b/src/components/Channel/hooks/useCreateTypingContext.ts index ee55dfe04c..726156fee4 100644 --- a/src/components/Channel/hooks/useCreateTypingContext.ts +++ b/src/components/Channel/hooks/useCreateTypingContext.ts @@ -4,7 +4,7 @@ import type { TypingContextValue } from '../../../context/TypingContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useCreateTypingContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( value: TypingContextValue, ) => { diff --git a/src/components/Channel/hooks/useEditMessageHandler.ts b/src/components/Channel/hooks/useEditMessageHandler.ts index f5067e8870..90936157e1 100644 --- a/src/components/Channel/hooks/useEditMessageHandler.ts +++ b/src/components/Channel/hooks/useEditMessageHandler.ts @@ -5,7 +5,7 @@ import type { StreamChat, UpdatedMessage } from 'stream-chat'; import type { DefaultStreamChatGenerics, UpdateMessageOptions } from '../../../types/types'; type UpdateHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ( cid: string, updatedMessage: UpdatedMessage, @@ -13,7 +13,7 @@ type UpdateHandler< ) => ReturnType['updateMessage']>; export const useEditMessageHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( doUpdateMessageRequest?: UpdateHandler, ) => { diff --git a/src/components/Channel/hooks/useMentionsHandlers.ts b/src/components/Channel/hooks/useMentionsHandlers.ts index ea42f6fab9..9860acc347 100644 --- a/src/components/Channel/hooks/useMentionsHandlers.ts +++ b/src/components/Channel/hooks/useMentionsHandlers.ts @@ -5,11 +5,11 @@ import type { UserResponse } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type OnMentionAction< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (event: React.BaseSyntheticEvent, user?: UserResponse) => void; export const useMentionsHandlers = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( onMentionsHover?: OnMentionAction, onMentionsClick?: OnMentionAction, diff --git a/src/components/Channel/utils.ts b/src/components/Channel/utils.ts index aa7b6af1b6..9242bcdd9f 100644 --- a/src/components/Channel/utils.ts +++ b/src/components/Channel/utils.ts @@ -4,28 +4,30 @@ import type { ChannelState, MessageResponse } from 'stream-chat'; import type { ChannelNotifications } from '../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../types'; -export const makeAddNotifications = ( - setNotifications: Dispatch>, - notificationTimeouts: NodeJS.Timeout[], -) => (text: string, type: 'success' | 'error') => { - if (typeof text !== 'string' || (type !== 'success' && type !== 'error')) { - return; - } +export const makeAddNotifications = + ( + setNotifications: Dispatch>, + notificationTimeouts: NodeJS.Timeout[], + ) => + (text: string, type: 'success' | 'error') => { + if (typeof text !== 'string' || (type !== 'success' && type !== 'error')) { + return; + } - const id = nanoid(); + const id = nanoid(); - setNotifications((prevNotifications) => [...prevNotifications, { id, text, type }]); + setNotifications((prevNotifications) => [...prevNotifications, { id, text, type }]); - const timeout = setTimeout( - () => - setNotifications((prevNotifications) => - prevNotifications.filter((notification) => notification.id !== id), - ), - 5000, - ); + const timeout = setTimeout( + () => + setNotifications((prevNotifications) => + prevNotifications.filter((notification) => notification.id !== id), + ), + 5000, + ); - notificationTimeouts.push(timeout); -}; + notificationTimeouts.push(timeout); + }; /** * Utility function for jumpToFirstUnreadMessage @@ -33,7 +35,7 @@ export const makeAddNotifications = ( * @param msgSet */ export const findInMsgSetById = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( targetId: string, msgSet: ReturnType['formatMessage']>[], @@ -59,7 +61,7 @@ export const findInMsgSetById = < * @param exact */ export const findInMsgSetByDate = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( targetDate: Date, msgSet: diff --git a/src/components/ChannelHeader/ChannelHeader.tsx b/src/components/ChannelHeader/ChannelHeader.tsx index 05e56d9d96..c102e6050c 100644 --- a/src/components/ChannelHeader/ChannelHeader.tsx +++ b/src/components/ChannelHeader/ChannelHeader.tsx @@ -28,7 +28,7 @@ export type ChannelHeaderProps = { * The ChannelHeader component renders some basic information about a Channel. */ export const ChannelHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ChannelHeaderProps, ) => { diff --git a/src/components/ChannelHeader/__tests__/ChannelHeader.test.js b/src/components/ChannelHeader/__tests__/ChannelHeader.test.js index d91c2dd4e4..3988ca731a 100644 --- a/src/components/ChannelHeader/__tests__/ChannelHeader.test.js +++ b/src/components/ChannelHeader/__tests__/ChannelHeader.test.js @@ -59,7 +59,7 @@ async function renderComponent(props, channelData, channelType = 'messaging') { return renderComponentBase({ channel, client, props }); } -afterEach(cleanup); +afterEach(cleanup); describe('ChannelHeader', () => { it('should display live label when prop live is true', async () => { diff --git a/src/components/ChannelList/ChannelList.tsx b/src/components/ChannelList/ChannelList.tsx index 8d154a580a..0286cdbbdf 100644 --- a/src/components/ChannelList/ChannelList.tsx +++ b/src/components/ChannelList/ChannelList.tsx @@ -43,7 +43,7 @@ const DEFAULT_OPTIONS = {}; const DEFAULT_SORT = {}; export type ChannelListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Additional props for underlying ChannelSearch component and channel search controller, [available props](https://getstream.io/chat/docs/sdk/react/utility-components/channel_search/#props) */ additionalChannelSearchProps?: Omit, 'setChannels'>; @@ -161,7 +161,7 @@ export type ChannelListProps< }; const UnMemoizedChannelList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ChannelListProps, ) => { @@ -260,9 +260,10 @@ const UnMemoizedChannelList = < * For some events, inner properties on the channel will update but the shallow comparison will not * force a re-render. Incrementing this dummy variable ensures the channel previews update. */ - const forceUpdate = useCallback(() => setChannelUpdateCount((count) => count + 1), [ - setChannelUpdateCount, - ]); + const forceUpdate = useCallback( + () => setChannelUpdateCount((count) => count + 1), + [setChannelUpdateCount], + ); const onSearch = useCallback((event: React.ChangeEvent) => { if (!event.target.value) { diff --git a/src/components/ChannelList/ChannelListMessenger.tsx b/src/components/ChannelList/ChannelListMessenger.tsx index 234222bcc2..fab76f40ac 100644 --- a/src/components/ChannelList/ChannelListMessenger.tsx +++ b/src/components/ChannelList/ChannelListMessenger.tsx @@ -8,7 +8,7 @@ import type { APIErrorResponse, Channel, ErrorFromResponse } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type ChannelListMessengerProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Whether the channel query request returned an errored response */ error: ErrorFromResponse | null; @@ -28,7 +28,7 @@ export type ChannelListMessengerProps< * A preview list of channels, allowing you to select the channel you want to open */ export const ChannelListMessenger = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: PropsWithChildren>, ) => { diff --git a/src/components/ChannelList/__tests__/ChannelList.test.js b/src/components/ChannelList/__tests__/ChannelList.test.js index d2e320ccb4..b0b00a06dd 100644 --- a/src/components/ChannelList/__tests__/ChannelList.test.js +++ b/src/components/ChannelList/__tests__/ChannelList.test.js @@ -294,7 +294,7 @@ describe('ChannelList', () => { // Wait for list of channels to load in DOM. await waitFor(() => { expect(getByRole('list')).toBeInTheDocument(); - + expect(queryAllByRole('listitem')).toHaveLength(1); }); const results = await axe(container); @@ -620,7 +620,7 @@ describe('ChannelList', () => { let channel; beforeEach(async () => { client = await getTestClientWithUser({ id: user1.id }); - + useMockedApis(client, [getOrCreateChannelApi(mockedChannels[0])]); channel = client.channel('messaging', mockedChannels[0].id); await channel.watch(); diff --git a/src/components/ChannelList/hooks/useChannelDeletedListener.ts b/src/components/ChannelList/hooks/useChannelDeletedListener.ts index 9e8db75273..f09b808e9d 100644 --- a/src/components/ChannelList/hooks/useChannelDeletedListener.ts +++ b/src/components/ChannelList/hooks/useChannelDeletedListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useChannelDeletedListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useChannelHiddenListener.ts b/src/components/ChannelList/hooks/useChannelHiddenListener.ts index e8b221a7d7..4b159dc44a 100644 --- a/src/components/ChannelList/hooks/useChannelHiddenListener.ts +++ b/src/components/ChannelList/hooks/useChannelHiddenListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useChannelHiddenListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useChannelTruncatedListener.ts b/src/components/ChannelList/hooks/useChannelTruncatedListener.ts index 77e7c8b5df..295b05447d 100644 --- a/src/components/ChannelList/hooks/useChannelTruncatedListener.ts +++ b/src/components/ChannelList/hooks/useChannelTruncatedListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useChannelTruncatedListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useChannelUpdatedListener.ts b/src/components/ChannelList/hooks/useChannelUpdatedListener.ts index aa6fcfda82..39620b7e83 100644 --- a/src/components/ChannelList/hooks/useChannelUpdatedListener.ts +++ b/src/components/ChannelList/hooks/useChannelUpdatedListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useChannelUpdatedListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useChannelVisibleListener.ts b/src/components/ChannelList/hooks/useChannelVisibleListener.ts index cd71202921..8b4cd8c342 100644 --- a/src/components/ChannelList/hooks/useChannelVisibleListener.ts +++ b/src/components/ChannelList/hooks/useChannelVisibleListener.ts @@ -10,7 +10,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useChannelVisibleListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useConnectionRecoveredListener.ts b/src/components/ChannelList/hooks/useConnectionRecoveredListener.ts index d54bcebc5f..4e6543893e 100644 --- a/src/components/ChannelList/hooks/useConnectionRecoveredListener.ts +++ b/src/components/ChannelList/hooks/useConnectionRecoveredListener.ts @@ -5,7 +5,7 @@ import { useChatContext } from '../../../context/ChatContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useConnectionRecoveredListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( forceUpdate?: () => void, ) => { diff --git a/src/components/ChannelList/hooks/useMessageNewListener.ts b/src/components/ChannelList/hooks/useMessageNewListener.ts index 548d5f22da..889501d4f7 100644 --- a/src/components/ChannelList/hooks/useMessageNewListener.ts +++ b/src/components/ChannelList/hooks/useMessageNewListener.ts @@ -10,7 +10,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useMessageNewListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useNotificationAddedToChannelListener.ts b/src/components/ChannelList/hooks/useNotificationAddedToChannelListener.ts index 520d580ef0..0dfb074211 100644 --- a/src/components/ChannelList/hooks/useNotificationAddedToChannelListener.ts +++ b/src/components/ChannelList/hooks/useNotificationAddedToChannelListener.ts @@ -10,7 +10,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useNotificationAddedToChannelListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useNotificationMessageNewListener.ts b/src/components/ChannelList/hooks/useNotificationMessageNewListener.ts index 6fd242b7da..5f39beef91 100644 --- a/src/components/ChannelList/hooks/useNotificationMessageNewListener.ts +++ b/src/components/ChannelList/hooks/useNotificationMessageNewListener.ts @@ -10,7 +10,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useNotificationMessageNewListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.ts b/src/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.ts index 00a5d3db22..57366e0581 100644 --- a/src/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.ts +++ b/src/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useNotificationRemovedFromChannelListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, customHandler?: ( diff --git a/src/components/ChannelList/hooks/usePaginatedChannels.ts b/src/components/ChannelList/hooks/usePaginatedChannels.ts index 8387bdc09b..341f4af750 100644 --- a/src/components/ChannelList/hooks/usePaginatedChannels.ts +++ b/src/components/ChannelList/hooks/usePaginatedChannels.ts @@ -17,7 +17,7 @@ const MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS = 2000; type AllowedQueryType = Extract; export type CustomQueryChannelParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { currentChannels: Array>; queryType: AllowedQueryType; @@ -26,11 +26,11 @@ export type CustomQueryChannelParams< }; export type CustomQueryChannelsFn< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (params: CustomQueryChannelParams) => Promise; export const usePaginatedChannels = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( client: StreamChat, filters: ChannelFilters, @@ -53,7 +53,7 @@ export const usePaginatedChannels = < const recoveryThrottleInterval = recoveryThrottleIntervalMs < MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS ? MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS - : recoveryThrottleIntervalMs ?? RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS; + : (recoveryThrottleIntervalMs ?? RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS); // memoize props const filterString = useMemo(() => JSON.stringify(filters), [filters]); const sortString = useMemo(() => JSON.stringify(sort), [sort]); diff --git a/src/components/ChannelList/hooks/useUserPresenceChangedListener.ts b/src/components/ChannelList/hooks/useUserPresenceChangedListener.ts index 771942caae..9d876f994a 100644 --- a/src/components/ChannelList/hooks/useUserPresenceChangedListener.ts +++ b/src/components/ChannelList/hooks/useUserPresenceChangedListener.ts @@ -7,7 +7,7 @@ import type { Channel, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useUserPresenceChangedListener = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( setChannels: React.Dispatch>>>, ) => { diff --git a/src/components/ChannelList/utils.ts b/src/components/ChannelList/utils.ts index 6b7d3a5bcc..349b58c9f0 100644 --- a/src/components/ChannelList/utils.ts +++ b/src/components/ChannelList/utils.ts @@ -6,7 +6,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; export const MAX_QUERY_CHANNELS_LIMIT = 30; type MoveChannelUpParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { channels: Array>; cid: string; @@ -14,7 +14,7 @@ type MoveChannelUpParams< }; export const moveChannelUp = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ activeChannel, channels, diff --git a/src/components/ChannelPreview/ChannelPreview.tsx b/src/components/ChannelPreview/ChannelPreview.tsx index a25bd333e0..a3a89205bc 100644 --- a/src/components/ChannelPreview/ChannelPreview.tsx +++ b/src/components/ChannelPreview/ChannelPreview.tsx @@ -19,7 +19,7 @@ import type { TranslationContextValue } from '../../context/TranslationContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type ChannelPreviewUIComponentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ChannelPreviewProps & { /** If the component's channel is the active (selected) Channel */ active?: boolean; @@ -42,7 +42,7 @@ export type ChannelPreviewUIComponentProps< }; export type ChannelPreviewProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Comes from either the `channelRenderFilterFn` or `usePaginatedChannels` call from [ChannelList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelList.tsx) */ channel: Channel; @@ -72,7 +72,7 @@ export type ChannelPreviewProps< }; export const ChannelPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ChannelPreviewProps, ) => { diff --git a/src/components/ChannelPreview/ChannelPreviewMessenger.tsx b/src/components/ChannelPreview/ChannelPreviewMessenger.tsx index 4fb9c5435d..b14e400544 100644 --- a/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +++ b/src/components/ChannelPreview/ChannelPreviewMessenger.tsx @@ -6,7 +6,7 @@ import type { ChannelPreviewUIComponentProps } from './ChannelPreview'; import type { DefaultStreamChatGenerics } from '../../types/types'; const UnMemoizedChannelPreviewMessenger = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ChannelPreviewUIComponentProps, ) => { diff --git a/src/components/ChannelPreview/__tests__/ChannelPreview.test.js b/src/components/ChannelPreview/__tests__/ChannelPreview.test.js index 41cd5a7465..993e98a20c 100644 --- a/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +++ b/src/components/ChannelPreview/__tests__/ChannelPreview.test.js @@ -98,7 +98,6 @@ describe('ChannelPreview', () => { [c0, c1] = await client.queryChannels({}, {}); }); - it('should mark channel as read, when set as active channel', async () => { // Mock the countUnread function on channel, to return 10. c0.countUnread = () => 10; diff --git a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js index 748f29ef5d..990522627c 100644 --- a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +++ b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js @@ -74,7 +74,6 @@ describe('ChannelPreviewMessenger', () => { fireEvent.click(getByTestId(PREVIEW_TEST_ID)); await waitFor(() => { - expect(setActiveChannel).toHaveBeenCalledTimes(1); expect(setActiveChannel).toHaveBeenCalledWith(channel, {}); }); diff --git a/src/components/ChannelPreview/hooks/useChannelPreviewInfo.ts b/src/components/ChannelPreview/hooks/useChannelPreviewInfo.ts index 336b7eb768..27cd346a97 100644 --- a/src/components/ChannelPreview/hooks/useChannelPreviewInfo.ts +++ b/src/components/ChannelPreview/hooks/useChannelPreviewInfo.ts @@ -15,7 +15,7 @@ export type ChannelPreviewInfoParams( props: ChannelPreviewInfoParams, ) => { diff --git a/src/components/ChannelPreview/hooks/useIsChannelMuted.ts b/src/components/ChannelPreview/hooks/useIsChannelMuted.ts index cda462f77e..2e9c471979 100644 --- a/src/components/ChannelPreview/hooks/useIsChannelMuted.ts +++ b/src/components/ChannelPreview/hooks/useIsChannelMuted.ts @@ -7,7 +7,7 @@ import type { Channel } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useIsChannelMuted = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel: Channel, ) => { diff --git a/src/components/ChannelPreview/hooks/useMessageDeliveryStatus.ts b/src/components/ChannelPreview/hooks/useMessageDeliveryStatus.ts index d7c63aa34b..301fcd9f36 100644 --- a/src/components/ChannelPreview/hooks/useMessageDeliveryStatus.ts +++ b/src/components/ChannelPreview/hooks/useMessageDeliveryStatus.ts @@ -12,7 +12,7 @@ export enum MessageDeliveryStatus { } type UseMessageStatusParamsChannelPreviewProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { channel: Channel; /** The last message received in a channel */ @@ -20,7 +20,7 @@ type UseMessageStatusParamsChannelPreviewProps< }; export const useMessageDeliveryStatus = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ channel, lastMessage, diff --git a/src/components/ChannelPreview/utils.tsx b/src/components/ChannelPreview/utils.tsx index 4b79ddd0ba..9a59b7bb3f 100644 --- a/src/components/ChannelPreview/utils.tsx +++ b/src/components/ChannelPreview/utils.tsx @@ -12,7 +12,7 @@ import { ChatContextValue } from '../../context'; export const renderPreviewText = (text: string) => {text}; const getLatestPollVote = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( latestVotesByOption: Record[]>, ) => { @@ -28,7 +28,7 @@ const getLatestPollVote = < }; export const getLatestMessagePreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel: Channel, t: TranslationContextValue['t'], @@ -55,7 +55,7 @@ export const getLatestMessagePreview = < const createdBy = poll.created_by?.id === channel.getClient().userID ? t('You') - : poll.created_by?.name ?? t('Poll'); + : (poll.created_by?.name ?? t('Poll')); return t('📊 {{createdBy}} created: {{ pollName}}', { createdBy, pollName: poll.name, @@ -72,7 +72,7 @@ export const getLatestMessagePreview = < votedBy: latestVote?.user?.id === channel.getClient().userID ? t('You') - : latestVote.user?.name ?? t('Poll'), + : (latestVote.user?.name ?? t('Poll')), }); } } @@ -98,7 +98,7 @@ export const getLatestMessagePreview = < export type GroupChannelDisplayInfo = { image?: string; name?: string }[]; export const getGroupChannelDisplayInfo = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel: Channel, ): GroupChannelDisplayInfo | undefined => { @@ -116,7 +116,7 @@ export const getGroupChannelDisplayInfo = < }; const getChannelDisplayInfo = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( info: 'name' | 'image', channel: Channel, @@ -130,14 +130,14 @@ const getChannelDisplayInfo = < }; export const getDisplayTitle = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel: Channel, currentUser?: UserResponse, ) => getChannelDisplayInfo('name', channel, currentUser); export const getDisplayImage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( channel: Channel, currentUser?: UserResponse, diff --git a/src/components/ChannelSearch/ChannelSearch.tsx b/src/components/ChannelSearch/ChannelSearch.tsx index d6229db6f7..64f2d57a17 100644 --- a/src/components/ChannelSearch/ChannelSearch.tsx +++ b/src/components/ChannelSearch/ChannelSearch.tsx @@ -22,7 +22,7 @@ export type AdditionalChannelSearchProps = { }; export type ChannelSearchProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = AdditionalSearchBarProps & AdditionalSearchInputProps & AdditionalSearchResultsProps & @@ -30,7 +30,7 @@ export type ChannelSearchProps< ChannelSearchControllerParams; const UnMemoizedChannelSearch = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ChannelSearchProps, ) => { diff --git a/src/components/ChannelSearch/SearchResults.tsx b/src/components/ChannelSearch/SearchResults.tsx index ea03d82461..ef233e3cff 100644 --- a/src/components/ChannelSearch/SearchResults.tsx +++ b/src/components/ChannelSearch/SearchResults.tsx @@ -21,11 +21,11 @@ const DefaultSearchEmpty = () => { }; export type SearchResultsHeaderProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'results'>; const DefaultSearchResultsHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ results, }: SearchResultsHeaderProps) => { @@ -43,7 +43,7 @@ const DefaultSearchResultsHeader = < }; export type SearchResultsListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Required< Pick, 'results' | 'SearchResultItem' | 'selectResult'> > & { @@ -51,7 +51,7 @@ export type SearchResultsListProps< }; const DefaultSearchResultsList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: SearchResultsListProps, ) => { @@ -73,7 +73,7 @@ const DefaultSearchResultsList = < }; export type SearchResultItemProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'selectResult'> & { index: number; result: ChannelOrUserResponse; @@ -81,7 +81,7 @@ export type SearchResultItemProps< }; const DefaultSearchResultItem = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: SearchResultItemProps, ) => { @@ -143,7 +143,7 @@ const ResultsContainer = ({ }; export type SearchResultsController< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { results: Array>; searching: boolean; @@ -151,7 +151,7 @@ export type SearchResultsController< }; export type AdditionalSearchResultsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Display search results as an absolutely positioned popup, defaults to false and shows inline */ popupResults?: boolean; @@ -168,11 +168,11 @@ export type AdditionalSearchResultsProps< }; export type SearchResultsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = AdditionalSearchResultsProps & SearchResultsController; export const SearchResults = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: SearchResultsProps, ) => { diff --git a/src/components/ChannelSearch/__tests__/SearchBar.test.js b/src/components/ChannelSearch/__tests__/SearchBar.test.js index 8ccf9c8eab..cf391b341a 100644 --- a/src/components/ChannelSearch/__tests__/SearchBar.test.js +++ b/src/components/ChannelSearch/__tests__/SearchBar.test.js @@ -43,7 +43,7 @@ describe('SearchBar', () => { beforeEach(async () => { const user = generateUser(); client = await getTestClientWithUser({ id: user.id }); - useMockedApis(client, [queryUsersApi([user])]); + useMockedApis(client, [queryUsersApi([user])]); }); it.each([ diff --git a/src/components/ChannelSearch/hooks/useChannelSearch.ts b/src/components/ChannelSearch/hooks/useChannelSearch.ts index 72952f6b1b..bb2c5f5abe 100644 --- a/src/components/ChannelSearch/hooks/useChannelSearch.ts +++ b/src/components/ChannelSearch/hooks/useChannelSearch.ts @@ -22,7 +22,7 @@ import type { SearchResultsController } from '../SearchResults'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type ChannelSearchFunctionParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { setQuery: React.Dispatch>; setResults: React.Dispatch[]>>; @@ -30,11 +30,11 @@ export type ChannelSearchFunctionParams< }; export type SearchController< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = SearchInputController & SearchBarController & SearchResultsController; export type SearchQueryParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { channelFilters?: { filters?: ChannelFilters; @@ -51,7 +51,7 @@ export type SearchQueryParams< }; export type ChannelSearchParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** The type of channel to create on user result select, defaults to `messaging` */ channelType?: string; @@ -82,14 +82,14 @@ export type ChannelSearchParams< }; export type ChannelSearchControllerParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ChannelSearchParams & { /** Set the array of channels displayed in the ChannelList */ setChannels?: React.Dispatch>>>; }; export const useChannelSearch = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ channelType = 'messaging', clearSearchOnClickOutside = true, @@ -156,7 +156,6 @@ export const useChannelSearch = < document.addEventListener('click', clickListener); return () => document.removeEventListener('click', clickListener); - }, [disabled, inputIsFocused, query, exitSearch, clearSearchOnClickOutside]); useEffect(() => { diff --git a/src/components/ChannelSearch/utils.ts b/src/components/ChannelSearch/utils.ts index 31409f92e5..89e03d308c 100644 --- a/src/components/ChannelSearch/utils.ts +++ b/src/components/ChannelSearch/utils.ts @@ -3,11 +3,11 @@ import type { Channel, UserResponse } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type ChannelOrUserResponse< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Channel | UserResponse; export const isChannel = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( output: ChannelOrUserResponse, ): output is Channel => (output as Channel).cid != null; diff --git a/src/components/Chat/Chat.tsx b/src/components/Chat/Chat.tsx index b908ee47bf..f65b6a1ff5 100644 --- a/src/components/Chat/Chat.tsx +++ b/src/components/Chat/Chat.tsx @@ -15,7 +15,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; import type { MessageContextValue } from '../../context'; export type ChatProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** The StreamChat client object */ client: StreamChat; @@ -44,7 +44,7 @@ export type ChatProps< * as it provides the ChatContext. */ export const Chat = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: PropsWithChildren>, ) => { diff --git a/src/components/Chat/hooks/useChat.ts b/src/components/Chat/hooks/useChat.ts index 168c4c76e3..a31d2a32de 100644 --- a/src/components/Chat/hooks/useChat.ts +++ b/src/components/Chat/hooks/useChat.ts @@ -13,7 +13,7 @@ import type { AppSettingsAPIResponse, Channel, Event, Mute, StreamChat } from 's import type { DefaultStreamChatGenerics } from '../../../types/types'; export type UseChatParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { client: StreamChat; defaultLanguage?: SupportedTranslations; @@ -22,7 +22,7 @@ export type UseChatParams< }; export const useChat = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ client, defaultLanguage = 'en', diff --git a/src/components/Chat/hooks/useCreateChatContext.ts b/src/components/Chat/hooks/useCreateChatContext.ts index d9cec2b0ba..5423628479 100644 --- a/src/components/Chat/hooks/useCreateChatContext.ts +++ b/src/components/Chat/hooks/useCreateChatContext.ts @@ -4,7 +4,7 @@ import type { ChatContextValue } from '../../../context/ChatContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useCreateChatContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( value: ChatContextValue, ) => { diff --git a/src/components/ChatAutoComplete/ChatAutoComplete.tsx b/src/components/ChatAutoComplete/ChatAutoComplete.tsx index 795ebef361..93a27f76be 100644 --- a/src/components/ChatAutoComplete/ChatAutoComplete.tsx +++ b/src/components/ChatAutoComplete/ChatAutoComplete.tsx @@ -16,24 +16,24 @@ import { EmojiSearchIndex, EmojiSearchIndexResult } from '../MessageInput'; type ObjectUnion = T[keyof T]; export type SuggestionCommand< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = CommandResponse; export type SuggestionUser< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = UserResponse; export type SuggestionEmoji = EmojiSearchIndexResult & T; export type SuggestionItem< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - T extends UnknownType = UnknownType + T extends UnknownType = UnknownType, > = SuggestionUser | SuggestionCommand | SuggestionEmoji; // FIXME: entity type is wrong, fix export type SuggestionItemProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - T extends UnknownType = UnknownType + T extends UnknownType = UnknownType, > = { className: string; component: React.ComponentType<{ @@ -59,41 +59,39 @@ export interface SuggestionHeaderProps { export type SuggestionListProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger -> = ObjectUnion< - { - [key in keyof TriggerSettings]: { - component: TriggerSettings[key]['component']; - currentTrigger: string; - dropdownScroll: (element: HTMLDivElement) => void; - getSelectedItem: - | ((item: Parameters[key]['output']>[0]) => void) - | null; - getTextToReplace: ( - item: Parameters[key]['output']>[0], - ) => { - caretPosition: 'start' | 'end' | 'next' | number; - text: string; - key?: string; - }; - Header: React.ComponentType; - onSelect: (newToken: { - caretPosition: 'start' | 'end' | 'next' | number; - text: string; - }) => void; - selectionEnd: number; - SuggestionItem: React.ComponentType; - values: Parameters< - Parameters[key]['dataProvider']>[2] - >[0]; - className?: string; - itemClassName?: string; - itemStyle?: React.CSSProperties; - style?: React.CSSProperties; - value?: string; + V extends CustomTrigger = CustomTrigger, +> = ObjectUnion<{ + [key in keyof TriggerSettings]: { + component: TriggerSettings[key]['component']; + currentTrigger: string; + dropdownScroll: (element: HTMLDivElement) => void; + getSelectedItem: + | ((item: Parameters[key]['output']>[0]) => void) + | null; + getTextToReplace: ( + item: Parameters[key]['output']>[0], + ) => { + caretPosition: 'start' | 'end' | 'next' | number; + text: string; + key?: string; }; - } ->; + Header: React.ComponentType; + onSelect: (newToken: { + caretPosition: 'start' | 'end' | 'next' | number; + text: string; + }) => void; + selectionEnd: number; + SuggestionItem: React.ComponentType; + values: Parameters< + Parameters[key]['dataProvider']>[2] + >[0]; + className?: string; + itemClassName?: string; + itemStyle?: React.CSSProperties; + style?: React.CSSProperties; + value?: string; + }; +}>; export type ChatAutoCompleteProps = { /** Function to override the default submit handler on the underlying `textarea` component */ @@ -118,14 +116,12 @@ export type ChatAutoCompleteProps = { const UnMemoizedChatAutoComplete = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: ChatAutoCompleteProps, ) => { - const { - AutocompleteSuggestionItem: SuggestionItem, - AutocompleteSuggestionList: SuggestionList, - } = useComponentContext('ChatAutoComplete'); + const { AutocompleteSuggestionItem: SuggestionItem, AutocompleteSuggestionList: SuggestionList } = + useComponentContext('ChatAutoComplete'); const { t } = useTranslationContext('ChatAutoComplete'); const messageInput = useMessageInputContext('ChatAutoComplete'); diff --git a/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js b/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js index 67e0b0b9a2..b57c86bca6 100644 --- a/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js +++ b/src/components/ChatAutoComplete/__tests__/ChatAutocomplete.test.js @@ -214,7 +214,6 @@ describe('ChatAutoComplete', () => { typeText(userAutocompleteText); const userText = await queryAllByText(user.name); - expect(userText).toHaveLength(0); }); diff --git a/src/components/CommandItem/__tests__/CommandItem.test.js b/src/components/CommandItem/__tests__/CommandItem.test.js index 5afccb789b..dd21eb54cf 100644 --- a/src/components/CommandItem/__tests__/CommandItem.test.js +++ b/src/components/CommandItem/__tests__/CommandItem.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { CommandItem } from '../CommandItem'; -afterEach(cleanup); +afterEach(cleanup); describe('commandItem', () => { it('should render component with empty entity', () => { diff --git a/src/components/DateSeparator/__tests__/DateSeparator.test.js b/src/components/DateSeparator/__tests__/DateSeparator.test.js index 87072858b9..0ae4015f29 100644 --- a/src/components/DateSeparator/__tests__/DateSeparator.test.js +++ b/src/components/DateSeparator/__tests__/DateSeparator.test.js @@ -12,7 +12,7 @@ import { Streami18n } from '../../../i18n'; Dayjs.extend(calendar); -afterEach(cleanup); +afterEach(cleanup); const DATE_SEPARATOR_TEST_ID = 'date-separator'; const dateMock = 'the date'; diff --git a/src/components/Dialog/FormDialog.tsx b/src/components/Dialog/FormDialog.tsx index d9eacd9d37..07fa88cc70 100644 --- a/src/components/Dialog/FormDialog.tsx +++ b/src/components/Dialog/FormDialog.tsx @@ -36,7 +36,7 @@ type FormValue> = { }; export const FormDialog = < - F extends FormValue> = FormValue> + F extends FormValue> = FormValue>, >({ className, close, diff --git a/src/components/DragAndDrop/DragAndDropContainer.tsx b/src/components/DragAndDrop/DragAndDropContainer.tsx index fda1cbd903..5a054cdf00 100644 --- a/src/components/DragAndDrop/DragAndDropContainer.tsx +++ b/src/components/DragAndDrop/DragAndDropContainer.tsx @@ -22,8 +22,8 @@ export const DragAndDropContainer = ({ dragStartIndex === null || dragOverIndex === null ? undefined : dragStartIndex <= dragOverIndex - ? 'down' - : 'up'; + ? 'down' + : 'up'; const childrenArray = React.Children.toArray(children); diff --git a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js index 8d036661e0..286b083721 100644 --- a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js +++ b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { EmoticonItem } from '../EmoticonItem'; -afterEach(cleanup); +afterEach(cleanup); describe('EmoticonItem', () => { it('should render component with empty entity', () => { diff --git a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js index f0a5b88cd1..34ec6dc441 100644 --- a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js +++ b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { EmptyStateIndicator } from '../EmptyStateIndicator'; -afterEach(cleanup); +afterEach(cleanup); describe('EmptyStateIndicator', () => { it('should render with default props', () => { diff --git a/src/components/EventComponent/EventComponent.tsx b/src/components/EventComponent/EventComponent.tsx index ce09b8e217..70cb6d4dad 100644 --- a/src/components/EventComponent/EventComponent.tsx +++ b/src/components/EventComponent/EventComponent.tsx @@ -10,7 +10,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; import type { TimestampFormatterOptions } from '../../i18n/types'; export type EventComponentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = TimestampFormatterOptions & { /** Message object */ message: StreamMessage; @@ -22,7 +22,7 @@ export type EventComponentProps< * Component to display system and channel event messages */ const UnMemoizedEventComponent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: EventComponentProps, ) => { diff --git a/src/components/Gallery/Gallery.tsx b/src/components/Gallery/Gallery.tsx index c5bd3aa507..b4cc3954b7 100644 --- a/src/components/Gallery/Gallery.tsx +++ b/src/components/Gallery/Gallery.tsx @@ -14,7 +14,7 @@ import type { Attachment } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type GalleryProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { images: (( | { @@ -27,7 +27,7 @@ export type GalleryProps< }; const UnMemoizedGallery = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: GalleryProps, ) => { @@ -36,9 +36,8 @@ const UnMemoizedGallery = < const [index, setIndex] = useState(0); const [modalOpen, setModalOpen] = useState(false); - const { BaseImage = DefaultBaseImage, ModalGallery = DefaultModalGallery } = useComponentContext( - 'Gallery', - ); + const { BaseImage = DefaultBaseImage, ModalGallery = DefaultModalGallery } = + useComponentContext('Gallery'); const { t } = useTranslationContext('Gallery'); const imageFallbackTitle = t('User uploaded content'); diff --git a/src/components/Gallery/Image.tsx b/src/components/Gallery/Image.tsx index d3d23f7fcd..00ec7af6bf 100644 --- a/src/components/Gallery/Image.tsx +++ b/src/components/Gallery/Image.tsx @@ -10,7 +10,7 @@ import type { Attachment } from 'stream-chat'; import type { DefaultStreamChatGenerics, Dimensions } from '../../types/types'; export type ImageProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { dimensions?: Dimensions; innerRef?: MutableRefObject; @@ -32,16 +32,15 @@ export type ImageProps< * A simple component that displays an image. */ export const ImageComponent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ImageProps, ) => { const { dimensions = {}, fallback, image_url, thumb_url, innerRef, previewUrl, style } = props; const [modalIsOpen, setModalIsOpen] = useState(false); - const { BaseImage = DefaultBaseImage, ModalGallery = DefaultModalGallery } = useComponentContext( - 'ImageComponent', - ); + const { BaseImage = DefaultBaseImage, ModalGallery = DefaultModalGallery } = + useComponentContext('ImageComponent'); const imageSrc = sanitizeUrl(previewUrl || image_url || thumb_url); diff --git a/src/components/Gallery/ModalGallery.tsx b/src/components/Gallery/ModalGallery.tsx index dd55e040f5..f2a7942b3d 100644 --- a/src/components/Gallery/ModalGallery.tsx +++ b/src/components/Gallery/ModalGallery.tsx @@ -7,7 +7,7 @@ import type { Attachment } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type ModalGalleryProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** The images for the Carousel component */ images: Attachment[]; @@ -26,7 +26,7 @@ const renderItem = ({ original, originalAlt }: ReactImageGalleryItem) => ( ); export const ModalGallery = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ModalGalleryProps, ) => { diff --git a/src/components/Gallery/__tests__/Image.test.js b/src/components/Gallery/__tests__/Image.test.js index a09561f0c4..29e15568ec 100644 --- a/src/components/Gallery/__tests__/Image.test.js +++ b/src/components/Gallery/__tests__/Image.test.js @@ -31,7 +31,6 @@ describe('Image', () => { describe('it should prevent unsafe image uri protocols in the rendered image src', () => { it('should prevent javascript protocol in image src', () => { - const xssJavascriptUri = 'javascript:alert("p0wn3d")'; const { getByTestId } = render( @@ -41,7 +40,6 @@ describe('Image', () => { expect(getByTestId('image-test')).not.toHaveAttribute('src', xssJavascriptUri); }); it('should prevent javascript protocol in thumbnail src', () => { - const xssJavascriptUri = 'javascript:alert("p0wn3d")'; const { getByTestId } = render( diff --git a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js index 336a8fd9a0..ef122d037e 100644 --- a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js +++ b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js @@ -105,7 +105,7 @@ describe('InfiniteScroll', () => { consoleWarnSpy.mockRestore(); expect(oldLoaderSpy).not.toHaveBeenCalled(); - + expect(newLoaderSpy).toHaveBeenCalled(); }, ); diff --git a/src/components/Loading/LoadingErrorIndicator.tsx b/src/components/Loading/LoadingErrorIndicator.tsx index fc0b635bb6..f79ed66930 100644 --- a/src/components/Loading/LoadingErrorIndicator.tsx +++ b/src/components/Loading/LoadingErrorIndicator.tsx @@ -15,11 +15,7 @@ const UnMemoizedLoadingErrorIndicator = ({ error }: LoadingErrorIndicatorProps) if (!error) return null; - return ( -
- {t('Error: {{ errorMessage }}', { errorMessage: error.message })} -
- ); + return
{t('Error: {{ errorMessage }}', { errorMessage: error.message })}
; }; export const LoadingErrorIndicator = React.memo( diff --git a/src/components/Loading/__tests__/LoadingChannels.test.js b/src/components/Loading/__tests__/LoadingChannels.test.js index 6617323567..bb684cca60 100644 --- a/src/components/Loading/__tests__/LoadingChannels.test.js +++ b/src/components/Loading/__tests__/LoadingChannels.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { LoadingChannels } from '../LoadingChannels'; -afterEach(cleanup); +afterEach(cleanup); describe('LoadingChannels', () => { it('should render component with default props', () => { diff --git a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js index 584c764088..4d65ac4f82 100644 --- a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js @@ -9,7 +9,7 @@ import { Chat } from '../../Chat'; import { getTestClientWithUser } from '../../../mock-builders'; -afterEach(cleanup); +afterEach(cleanup); describe('LoadingErrorIndicator', () => { it('should return null if no error is provided', () => { diff --git a/src/components/Loading/__tests__/LoadingIndicator.test.js b/src/components/Loading/__tests__/LoadingIndicator.test.js index 9e93184ae7..0b46229116 100644 --- a/src/components/Loading/__tests__/LoadingIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingIndicator.test.js @@ -5,7 +5,7 @@ import '@testing-library/jest-dom'; import { LoadingIndicator } from '../LoadingIndicator'; -afterEach(cleanup); +afterEach(cleanup); describe('LoadingIndicator', () => { it('should render with default props', () => { diff --git a/src/components/MML/__tests__/MML.test.js b/src/components/MML/__tests__/MML.test.js index 947a079add..c84c52f5bc 100644 --- a/src/components/MML/__tests__/MML.test.js +++ b/src/components/MML/__tests__/MML.test.js @@ -7,7 +7,7 @@ import { MML } from '../MML'; import { ChatProvider } from '../../../context/ChatContext'; import { MessageProvider } from '../../../context/MessageContext'; -afterEach(cleanup); +afterEach(cleanup); const renderComponent = async ( { chatCtx = {}, messageCtx = {}, mmlProps }, diff --git a/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js b/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js index 7c9b56793d..be41a20848 100644 --- a/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js +++ b/src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecorder.test.js @@ -116,19 +116,16 @@ window.navigator.permissions = { query: jest.fn(), }; - window.MediaRecorder = MediaRecorderMock; - window.AudioContext = AudioContextMock; - window.AnalyserNode = AnalyserNodeMock; const fileObjectURL = 'fileObjectURL'; - + window.URL.createObjectURL = jest.fn(() => fileObjectURL); - + window.URL.revokeObjectURL = jest.fn(); describe('MessageInput', () => { diff --git a/src/components/MediaRecorder/classes/BrowserPermission.ts b/src/components/MediaRecorder/classes/BrowserPermission.ts index 749c2c117b..0ecb702aec 100644 --- a/src/components/MediaRecorder/classes/BrowserPermission.ts +++ b/src/components/MediaRecorder/classes/BrowserPermission.ts @@ -42,7 +42,7 @@ export class BrowserPermission { const status = this.status.value; const handlePermissionChange = (e: Event) => { - const { state } = ((e as unknown) as ChangeEvent).target; + const { state } = (e as unknown as ChangeEvent).target; this.state.next(state); }; status.addEventListener('change', handlePermissionChange); @@ -67,7 +67,7 @@ export class BrowserPermission { let permissionState: PermissionState; try { const permissionStatus = await navigator.permissions.query({ - name: (this.name as unknown) as PermissionName, + name: this.name as unknown as PermissionName, }); permissionState = permissionStatus.state; this.status.next(permissionStatus); diff --git a/src/components/MediaRecorder/classes/MediaRecorderController.ts b/src/components/MediaRecorder/classes/MediaRecorderController.ts index 13533c52af..b4bc91cb68 100644 --- a/src/components/MediaRecorder/classes/MediaRecorderController.ts +++ b/src/components/MediaRecorder/classes/MediaRecorderController.ts @@ -80,7 +80,7 @@ export enum RecordingAttachmentType { } export class MediaRecorderController< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > { permission: BrowserPermission; mediaRecorder: MediaRecorder | undefined; diff --git a/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js b/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js index be819af5c7..8ae6695923 100644 --- a/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js +++ b/src/components/MediaRecorder/classes/__tests__/AmplitudeRecorder.test.js @@ -5,7 +5,6 @@ import { } from '../AmplitudeRecorder'; import { AudioContextMock } from '../../../../mock-builders/browser'; - window.AudioContext = AudioContextMock; const intervalID = 1; diff --git a/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js b/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js index 46969dd5ac..94cc8ee2ee 100644 --- a/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js +++ b/src/components/MediaRecorder/classes/__tests__/MediaRecorderController.test.js @@ -65,15 +65,12 @@ const expectRegistersError = async ({ action, controller, errorMsg, notification notificationSubscription?.unsubscribe(); }; - window.MediaRecorder = MediaRecorderMock; - window.AudioContext = AudioContextMock; - window.URL.createObjectURL = jest.fn(() => fileObjectURL); - + window.URL.revokeObjectURL = jest.fn(); describe('MediaRecorderController', () => { diff --git a/src/components/MediaRecorder/hooks/useMediaRecorder.ts b/src/components/MediaRecorder/hooks/useMediaRecorder.ts index a1550d6334..f08f63e5ef 100644 --- a/src/components/MediaRecorder/hooks/useMediaRecorder.ts +++ b/src/components/MediaRecorder/hooks/useMediaRecorder.ts @@ -10,7 +10,7 @@ import type { LocalVoiceRecordingAttachment } from '../../MessageInput'; import type { DefaultStreamChatGenerics } from '../../../types'; export type RecordingController< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { completeRecording: () => void; permissionState?: PermissionState; @@ -20,7 +20,7 @@ export type RecordingController< }; type UseMediaRecorderParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick< MessageInputContextValue, 'asyncMessagesMultiSendEnabled' | 'handleSubmit' | 'uploadAttachment' @@ -31,7 +31,7 @@ type UseMediaRecorderParams< }; export const useMediaRecorder = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ asyncMessagesMultiSendEnabled, enabled, diff --git a/src/components/Message/FixedHeightMessage.tsx b/src/components/Message/FixedHeightMessage.tsx index 855c305e7e..1baa2a9333 100644 --- a/src/components/Message/FixedHeightMessage.tsx +++ b/src/components/Message/FixedHeightMessage.tsx @@ -29,8 +29,8 @@ const selectColor = (number: number, dark: boolean) => { const hashUserId = (userId: string) => { const hash = userId.split('').reduce((acc, c) => { - acc = (acc << 5) - acc + c.charCodeAt(0); - return acc & acc; + acc = (acc << 5) - acc + c.charCodeAt(0); + return acc & acc; }, 0); return Math.abs(hash) / 10 ** Math.ceil(Math.log10(Math.abs(hash) + 1)); }; @@ -39,14 +39,14 @@ const getUserColor = (theme: string, userId: string) => selectColor(hashUserId(userId), theme.includes('dark')); export type FixedHeightMessageProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { groupedByUser?: boolean; message?: StreamMessage; }; const UnMemoizedFixedHeightMessage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: FixedHeightMessageProps, ) => { @@ -54,14 +54,11 @@ const UnMemoizedFixedHeightMessage = < const { theme } = useChatContext('FixedHeightMessage'); - const { - groupedByUser: contextGroupedByUser, - message: contextMessage, - } = useMessageContext('FixedHeightMessage'); + const { groupedByUser: contextGroupedByUser, message: contextMessage } = + useMessageContext('FixedHeightMessage'); - const { MessageDeleted = DefaultMessageDeleted } = useComponentContext( - 'FixedHeightMessage', - ); + const { MessageDeleted = DefaultMessageDeleted } = + useComponentContext('FixedHeightMessage'); const { userLanguage } = useTranslationContext('FixedHeightMessage'); @@ -75,10 +72,10 @@ const UnMemoizedFixedHeightMessage = < const messageTextToRender = message?.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] || message?.text; - const renderedText = useMemo(() => renderText(messageTextToRender, message.mentioned_users), [ - message.mentioned_users, - messageTextToRender, - ]); + const renderedText = useMemo( + () => renderText(messageTextToRender, message.mentioned_users), + [message.mentioned_users, messageTextToRender], + ); const userId = message.user?.id || ''; const userColor = useMemo(() => getUserColor(theme, userId), [userId, theme]); diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx index 171a6bae41..8317c5977b 100644 --- a/src/components/Message/Message.tsx +++ b/src/components/Message/Message.tsx @@ -53,7 +53,7 @@ type MessageContextPropsToPick = | 'sortReactionDetails'; type MessageWithContextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, MessagePropsToOmit> & Pick, MessageContextPropsToPick> & { canPin: boolean; @@ -61,7 +61,7 @@ type MessageWithContextProps< }; const MessageWithContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageWithContextProps, ) => { @@ -143,12 +143,12 @@ const MessageWithContext = < ); const { - canPin: canPinPropToNotPass, - messageActions: messageActionsPropToNotPass, - onlySenderCanEdit: onlySenderCanEditPropToNotPass, - onUserClick: onUserClickPropToNotPass, - onUserHover: onUserHoverPropToNotPass, - userRoles: userRolesPropToNotPass, + canPin: canPinPropToNotPass, + messageActions: messageActionsPropToNotPass, + onlySenderCanEdit: onlySenderCanEditPropToNotPass, + onUserClick: onUserClickPropToNotPass, + onUserHover: onUserHoverPropToNotPass, + userRoles: userRolesPropToNotPass, ...rest } = props; @@ -185,7 +185,7 @@ const MemoizedMessage = React.memo( * an individual message. The actual UI of the message is delegated via the Message prop on Channel. */ export const Message = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageProps, ) => { diff --git a/src/components/Message/MessageDeleted.tsx b/src/components/Message/MessageDeleted.tsx index 9b5a73d608..9a665f1815 100644 --- a/src/components/Message/MessageDeleted.tsx +++ b/src/components/Message/MessageDeleted.tsx @@ -9,13 +9,13 @@ import type { StreamMessage } from '../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type MessageDeletedProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { message: StreamMessage; }; export const MessageDeleted = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageDeletedProps, ) => { diff --git a/src/components/Message/MessageEditedTimestamp.tsx b/src/components/Message/MessageEditedTimestamp.tsx index 87db8539ff..0cc2e2b5b9 100644 --- a/src/components/Message/MessageEditedTimestamp.tsx +++ b/src/components/Message/MessageEditedTimestamp.tsx @@ -9,22 +9,21 @@ import type { DefaultStreamChatGenerics } from '../../types'; import type { MessageTimestampProps } from './MessageTimestamp'; export type MessageEditedTimestampProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = MessageTimestampProps & { open: boolean; }; export function MessageEditedTimestamp< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ message: propMessage, open, ...timestampProps }: MessageEditedTimestampProps) { const { t } = useTranslationContext('MessageEditedTimestamp'); - const { message: contextMessage } = useMessageContext( - 'MessageEditedTimestamp', - ); + const { message: contextMessage } = + useMessageContext('MessageEditedTimestamp'); const { Timestamp = DefaultTimestamp } = useComponentContext('MessageEditedTimestamp'); const message = propMessage || contextMessage; diff --git a/src/components/Message/MessageErrorText.tsx b/src/components/Message/MessageErrorText.tsx index fd4f7a1372..f1de754e82 100644 --- a/src/components/Message/MessageErrorText.tsx +++ b/src/components/Message/MessageErrorText.tsx @@ -5,14 +5,14 @@ import { DefaultStreamChatGenerics } from '../../types/types'; import { isMessageBounced } from './utils'; export interface MessageErrorTextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > { message: StreamMessage; theme: string; } export function MessageErrorText< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ message, theme }: MessageErrorTextProps) { const { t } = useTranslationContext('MessageText'); diff --git a/src/components/Message/MessageOptions.tsx b/src/components/Message/MessageOptions.tsx index 5f40654279..cb4d5c6d78 100644 --- a/src/components/Message/MessageOptions.tsx +++ b/src/components/Message/MessageOptions.tsx @@ -17,7 +17,7 @@ import type { DefaultStreamChatGenerics, IconProps } from '../../types/types'; import type { MessageContextValue } from '../../context/MessageContext'; export type MessageOptionsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial, 'handleOpenThread'>> & { /* Custom component rendering the icon used in message actions button. This button invokes the message actions menu. */ ActionsIcon?: React.ComponentType; @@ -32,7 +32,7 @@ export type MessageOptionsProps< }; const UnMemoizedMessageOptions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageOptionsProps, ) => { diff --git a/src/components/Message/MessageSimple.tsx b/src/components/Message/MessageSimple.tsx index e82200fed7..38bd1f470a 100644 --- a/src/components/Message/MessageSimple.tsx +++ b/src/components/Message/MessageSimple.tsx @@ -37,11 +37,11 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; import { StreamedMessageText as DefaultStreamedMessageText } from './StreamedMessageText'; type MessageSimpleWithContextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = MessageContextValue; const MessageSimpleWithContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageSimpleWithContextProps, ) => { @@ -89,10 +89,10 @@ const MessageSimpleWithContext = < const hasAttachment = messageHasAttachments(message); const hasReactions = messageHasReactions(message); - const isAIGenerated = useMemo(() => isMessageAIGenerated?.(message), [ - isMessageAIGenerated, - message, - ]); + const isAIGenerated = useMemo( + () => isMessageAIGenerated?.(message), + [isMessageAIGenerated, message], + ); if (message.customType === CUSTOM_MESSAGE_TYPE.date) { return null; @@ -243,7 +243,7 @@ const MemoizedMessageSimple = React.memo( * The default UI component that renders a message and receives functionality and logic from the MessageContext. */ export const MessageSimple = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageUIComponentProps, ) => { diff --git a/src/components/Message/MessageStatus.tsx b/src/components/Message/MessageStatus.tsx index 1c96b7b73e..aab3607307 100644 --- a/src/components/Message/MessageStatus.tsx +++ b/src/components/Message/MessageStatus.tsx @@ -32,7 +32,7 @@ export type MessageStatusProps = { }; const UnMemoizedMessageStatus = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageStatusProps, ) => { @@ -49,13 +49,8 @@ const UnMemoizedMessageStatus = < const { client } = useChatContext('MessageStatus'); const { Avatar: contextAvatar } = useComponentContext('MessageStatus'); - const { - isMyMessage, - lastReceivedId, - message, - readBy, - threadList, - } = useMessageContext('MessageStatus'); + const { isMyMessage, lastReceivedId, message, readBy, threadList } = + useMessageContext('MessageStatus'); const { t } = useTranslationContext('MessageStatus'); const [referenceElement, setReferenceElement] = useState(null); diff --git a/src/components/Message/MessageText.tsx b/src/components/Message/MessageText.tsx index cb7919d76f..838770337a 100644 --- a/src/components/Message/MessageText.tsx +++ b/src/components/Message/MessageText.tsx @@ -13,7 +13,7 @@ import type { MessageContextValue, StreamMessage } from '../../context'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type MessageTextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /* Replaces the CSS class name placed on the component's inner `div` container */ customInnerClass?: string; @@ -26,7 +26,7 @@ export type MessageTextProps< } & Pick, 'renderText'>; const UnMemoizedMessageTextComponent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageTextProps, ) => { @@ -38,9 +38,8 @@ const UnMemoizedMessageTextComponent = < theme = 'simple', } = props; - const { QuotedMessage = DefaultQuotedMessage } = useComponentContext( - 'MessageText', - ); + const { QuotedMessage = DefaultQuotedMessage } = + useComponentContext('MessageText'); const { message: contextMessage, @@ -59,11 +58,11 @@ const UnMemoizedMessageTextComponent = < const messageTextToRender = message.i18n?.[`${userLanguage}_text` as `${TranslationLanguages}_text`] || message.text; - // eslint-disable-next-line react-hooks/exhaustive-deps - const messageText = useMemo(() => renderText(messageTextToRender, message.mentioned_users), [ - message.mentioned_users, - messageTextToRender, - ]); + const messageText = useMemo( + () => renderText(messageTextToRender, message.mentioned_users), + // eslint-disable-next-line react-hooks/exhaustive-deps + [message.mentioned_users, messageTextToRender], + ); const wrapperClass = customWrapperClass || 'str-chat__message-text'; const innerClass = diff --git a/src/components/Message/MessageTimestamp.tsx b/src/components/Message/MessageTimestamp.tsx index bf8959febb..f494ffb786 100644 --- a/src/components/Message/MessageTimestamp.tsx +++ b/src/components/Message/MessageTimestamp.tsx @@ -8,7 +8,7 @@ import type { TimestampFormatterOptions } from '../../i18n/types'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type MessageTimestampProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = TimestampFormatterOptions & { /* Adds a CSS class name to the component's outer `time` container. */ customClass?: string; @@ -17,7 +17,7 @@ export type MessageTimestampProps< }; const UnMemoizedMessageTimestamp = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageTimestampProps, ) => { diff --git a/src/components/Message/QuotedMessage.tsx b/src/components/Message/QuotedMessage.tsx index 22c680355d..7f81be7219 100644 --- a/src/components/Message/QuotedMessage.tsx +++ b/src/components/Message/QuotedMessage.tsx @@ -16,12 +16,10 @@ import type { TranslationLanguages } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types/types'; export const QuotedMessage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { - const { - Attachment = DefaultAttachment, - Avatar: ContextAvatar, - } = useComponentContext('QuotedMessage'); + const { Attachment = DefaultAttachment, Avatar: ContextAvatar } = + useComponentContext('QuotedMessage'); const { client } = useChatContext(); const { isMyMessage, message } = useMessageContext('QuotedMessage'); const { t, userLanguage } = useTranslationContext('QuotedMessage'); diff --git a/src/components/Message/StreamedMessageText.tsx b/src/components/Message/StreamedMessageText.tsx index 3005f3cd41..779dd030c2 100644 --- a/src/components/Message/StreamedMessageText.tsx +++ b/src/components/Message/StreamedMessageText.tsx @@ -6,14 +6,14 @@ import { useMessageContext } from '../../context'; import { useMessageTextStreaming } from './hooks'; export type StreamedMessageTextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, 'message' | 'renderText'> & { renderingLetterCount?: number; streamingLetterIntervalMs?: number; }; export const StreamedMessageText = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: StreamedMessageTextProps, ) => { @@ -23,9 +23,8 @@ export const StreamedMessageText = < renderText, streamingLetterIntervalMs, } = props; - const { message: messageFromContext } = useMessageContext( - 'StreamedMessageText', - ); + const { message: messageFromContext } = + useMessageContext('StreamedMessageText'); const message = messageFromProps || messageFromContext; const { text = '' } = message; const { streamedMessageText } = useMessageTextStreaming({ diff --git a/src/components/Message/__tests__/Message.test.js b/src/components/Message/__tests__/Message.test.js index aeedc5644d..e433fc4867 100644 --- a/src/components/Message/__tests__/Message.test.js +++ b/src/components/Message/__tests__/Message.test.js @@ -71,7 +71,6 @@ async function renderComponent({ > , ...components, }} diff --git a/src/components/Message/__tests__/MessageDeleted.test.js b/src/components/Message/__tests__/MessageDeleted.test.js index 6ceb7bc724..81d853d3a1 100644 --- a/src/components/Message/__tests__/MessageDeleted.test.js +++ b/src/components/Message/__tests__/MessageDeleted.test.js @@ -1,4 +1,3 @@ - import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; diff --git a/src/components/Message/__tests__/MessageOptions.test.js b/src/components/Message/__tests__/MessageOptions.test.js index 5587000e3b..3d2b30d348 100644 --- a/src/components/Message/__tests__/MessageOptions.test.js +++ b/src/components/Message/__tests__/MessageOptions.test.js @@ -1,4 +1,3 @@ - import React from 'react'; import { act, fireEvent, render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -68,7 +67,7 @@ async function renderMessageOptions({ , reactionOptions: defaultReactionOptions, }} @@ -158,7 +157,7 @@ describe('', () => { }); expect(handleOpenThread).not.toHaveBeenCalled(); fireEvent.click(getByTestId(threadActionTestId)); - + expect(handleOpenThread).toHaveBeenCalled(); }); diff --git a/src/components/Message/__tests__/MessageSimple.test.js b/src/components/Message/__tests__/MessageSimple.test.js index 353aab9041..94119f26b3 100644 --- a/src/components/Message/__tests__/MessageSimple.test.js +++ b/src/components/Message/__tests__/MessageSimple.test.js @@ -85,7 +85,7 @@ async function renderMessageSimple({ , reactionOptions: defaultReactionOptions, ...components, @@ -500,7 +500,7 @@ describe('', () => { handleOpenThread: jest.fn(), }, }); - + expect(MessageOptionsMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -556,7 +556,7 @@ describe('', () => { unsafeHTML, }, }); - + expect(MessageTextMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/Message/__tests__/MessageText.test.js b/src/components/Message/__tests__/MessageText.test.js index 5bbb501946..511a6874e9 100644 --- a/src/components/Message/__tests__/MessageText.test.js +++ b/src/components/Message/__tests__/MessageText.test.js @@ -1,4 +1,3 @@ - import '@testing-library/jest-dom'; import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { toHaveNoViolations } from 'jest-axe'; @@ -84,7 +83,7 @@ async function renderMessageText({ , reactionOptions: defaultReactionOptions, }} @@ -281,7 +280,7 @@ describe('', () => { }, }, }); - + expect(MessageOptionsMock).toHaveBeenCalled(); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/Message/hooks/useActionHandler.ts b/src/components/Message/hooks/useActionHandler.ts index 2ac1298902..ccf29ac220 100644 --- a/src/components/Message/hooks/useActionHandler.ts +++ b/src/components/Message/hooks/useActionHandler.ts @@ -17,11 +17,10 @@ export const handleActionWarning = `Action handler was called, but it is missing Make sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`; export function useActionHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(message?: StreamMessage): ActionHandlerReturnType { - const { removeMessage, updateMessage } = useChannelActionContext( - 'useActionHandler', - ); + const { removeMessage, updateMessage } = + useChannelActionContext('useActionHandler'); const { channel } = useChannelStateContext('useActionHandler'); return async (dataOrName, value, event) => { diff --git a/src/components/Message/hooks/useDeleteHandler.ts b/src/components/Message/hooks/useDeleteHandler.ts index 69a21158de..bcda02b230 100644 --- a/src/components/Message/hooks/useDeleteHandler.ts +++ b/src/components/Message/hooks/useDeleteHandler.ts @@ -11,23 +11,22 @@ import type { StreamMessage } from '../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type DeleteMessageNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (message: StreamMessage) => string; notify?: (notificationText: string, type: 'success' | 'error') => void; }; export const useDeleteHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, notifications: DeleteMessageNotifications = {}, ): ReactEventHandler => { const { getErrorNotification, notify } = notifications; - const { deleteMessage, updateMessage } = useChannelActionContext( - 'useDeleteHandler', - ); + const { deleteMessage, updateMessage } = + useChannelActionContext('useDeleteHandler'); const { client } = useChatContext('useDeleteHandler'); const { t } = useTranslationContext('useDeleteHandler'); diff --git a/src/components/Message/hooks/useFlagHandler.ts b/src/components/Message/hooks/useFlagHandler.ts index f4ba463c7a..694b805239 100644 --- a/src/components/Message/hooks/useFlagHandler.ts +++ b/src/components/Message/hooks/useFlagHandler.ts @@ -13,7 +13,7 @@ export const missingUseFlagHandlerParameterWarning = 'useFlagHandler was called but it is missing one or more necessary parameters.'; export type FlagMessageNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (message: StreamMessage) => string; getSuccessNotification?: (message: StreamMessage) => string; @@ -21,7 +21,7 @@ export type FlagMessageNotifications< }; export const useFlagHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, notifications: FlagMessageNotifications = {}, diff --git a/src/components/Message/hooks/useMarkUnreadHandler.ts b/src/components/Message/hooks/useMarkUnreadHandler.ts index 943187efaa..a601f57159 100644 --- a/src/components/Message/hooks/useMarkUnreadHandler.ts +++ b/src/components/Message/hooks/useMarkUnreadHandler.ts @@ -6,7 +6,7 @@ import type { ReactEventHandler } from '../types'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type MarkUnreadHandlerNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (message: StreamMessage) => string; getSuccessNotification?: (message: StreamMessage) => string; @@ -14,7 +14,7 @@ export type MarkUnreadHandlerNotifications< }; export const useMarkUnreadHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, notifications: MarkUnreadHandlerNotifications = {}, diff --git a/src/components/Message/hooks/useMentionsHandler.ts b/src/components/Message/hooks/useMentionsHandler.ts index 37ad0879e9..a0cc664812 100644 --- a/src/components/Message/hooks/useMentionsHandler.ts +++ b/src/components/Message/hooks/useMentionsHandler.ts @@ -10,15 +10,15 @@ import type { StreamMessage } from '../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type CustomMentionHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (event: React.BaseSyntheticEvent, mentioned_users: UserResponse[]) => void; export type MentionedUserEventHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (event: React.BaseSyntheticEvent, mentionedUsers: UserResponse[]) => void; function createEventHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( fn?: CustomMentionHandler, message?: StreamMessage, @@ -32,7 +32,7 @@ function createEventHandler< } export const useMentionsHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, customMentionHandler?: { @@ -40,10 +40,8 @@ export const useMentionsHandler = < onMentionsHover?: CustomMentionHandler; }, ) => { - const { - onMentionsClick: contextOnMentionsClick, - onMentionsHover: contextOnMentionsHover, - } = useChannelActionContext('useMentionsHandler'); + const { onMentionsClick: contextOnMentionsClick, onMentionsHover: contextOnMentionsHover } = + useChannelActionContext('useMentionsHandler'); const onMentionsClick = customMentionHandler?.onMentionsClick || contextOnMentionsClick || (() => null); diff --git a/src/components/Message/hooks/useMessageTextStreaming.ts b/src/components/Message/hooks/useMessageTextStreaming.ts index d791988c92..fb7cad2249 100644 --- a/src/components/Message/hooks/useMessageTextStreaming.ts +++ b/src/components/Message/hooks/useMessageTextStreaming.ts @@ -4,7 +4,7 @@ import type { DefaultStreamChatGenerics } from '../../../types/types'; import type { StreamedMessageTextProps } from '../StreamedMessageText'; export type UseMessageTextStreamingProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick< StreamedMessageTextProps, 'streamingLetterIntervalMs' | 'renderingLetterCount' @@ -22,7 +22,7 @@ const DEFAULT_RENDERING_LETTER_COUNT = 2; * @returns {{ streamedMessageText: string }} - A substring of the text property, up until we've finished rendering the typewriter animation. */ export const useMessageTextStreaming = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ streamingLetterIntervalMs = DEFAULT_LETTER_INTERVAL, renderingLetterCount = DEFAULT_RENDERING_LETTER_COUNT, diff --git a/src/components/Message/hooks/useMuteHandler.ts b/src/components/Message/hooks/useMuteHandler.ts index 1e4949e1ac..0fc4a8bc7a 100644 --- a/src/components/Message/hooks/useMuteHandler.ts +++ b/src/components/Message/hooks/useMuteHandler.ts @@ -14,7 +14,7 @@ export const missingUseMuteHandlerParamsWarning = 'useMuteHandler was called but it is missing one or more necessary parameter.'; export type MuteUserNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (user: UserResponse) => string; getSuccessNotification?: (user: UserResponse) => string; @@ -22,7 +22,7 @@ export type MuteUserNotifications< }; export const useMuteHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, notifications: MuteUserNotifications = {}, diff --git a/src/components/Message/hooks/useOpenThreadHandler.ts b/src/components/Message/hooks/useOpenThreadHandler.ts index b697300b1d..2bd85cd381 100644 --- a/src/components/Message/hooks/useOpenThreadHandler.ts +++ b/src/components/Message/hooks/useOpenThreadHandler.ts @@ -7,7 +7,7 @@ import type { StreamMessage } from '../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useOpenThreadHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, customOpenThread?: ( @@ -15,9 +15,8 @@ export const useOpenThreadHandler = < event: React.BaseSyntheticEvent, ) => void, ): ReactEventHandler => { - const { openThread: channelOpenThread } = useChannelActionContext( - 'useOpenThreadHandler', - ); + const { openThread: channelOpenThread } = + useChannelActionContext('useOpenThreadHandler'); const openThread = customOpenThread || channelOpenThread; diff --git a/src/components/Message/hooks/usePinHandler.ts b/src/components/Message/hooks/usePinHandler.ts index b0db607b75..513935e8e4 100644 --- a/src/components/Message/hooks/usePinHandler.ts +++ b/src/components/Message/hooks/usePinHandler.ts @@ -34,14 +34,14 @@ export type PinPermissions }; export type PinMessageNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (message: StreamMessage) => string; notify?: (notificationText: string, type: 'success' | 'error') => void; }; export const usePinHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: StreamMessage, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release diff --git a/src/components/Message/hooks/useReactionHandler.ts b/src/components/Message/hooks/useReactionHandler.ts index c493d6e14a..2172ba9175 100644 --- a/src/components/Message/hooks/useReactionHandler.ts +++ b/src/components/Message/hooks/useReactionHandler.ts @@ -15,15 +15,14 @@ export const reactionHandlerWarning = `Reaction handler was called, but it is mi Make sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`; export const useReactionHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, ) => { const thread = useThreadContext(); const { updateMessage } = useChannelActionContext('useReactionHandler'); - const { channel, channelCapabilities } = useChannelStateContext( - 'useReactionHandler', - ); + const { channel, channelCapabilities } = + useChannelStateContext('useReactionHandler'); const { client } = useChatContext('useReactionHandler'); const createMessagePreview = useCallback( @@ -120,7 +119,7 @@ export const useReactionHandler = < return console.warn(reactionHandlerWarning); } - let userExistingReaction = (null as unknown) as ReactionResponse; + let userExistingReaction = null as unknown as ReactionResponse; if (message.own_reactions) { message.own_reactions.forEach((reaction) => { diff --git a/src/components/Message/hooks/useReactionsFetcher.ts b/src/components/Message/hooks/useReactionsFetcher.ts index cbd50036cd..6dad0f1ed5 100644 --- a/src/components/Message/hooks/useReactionsFetcher.ts +++ b/src/components/Message/hooks/useReactionsFetcher.ts @@ -6,14 +6,14 @@ import { ReactionType } from '../../Reactions/types'; export const MAX_MESSAGE_REACTIONS_TO_FETCH = 1000; type FetchMessageReactionsNotifications< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { getErrorNotification?: (message: StreamMessage) => string; notify?: (notificationText: string, type: 'success' | 'error') => void; }; export function useReactionsFetcher< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: StreamMessage, notifications: FetchMessageReactionsNotifications = {}, @@ -37,7 +37,7 @@ export function useReactionsFetcher< } async function fetchMessageReactions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( client: StreamChat, messageId: string, diff --git a/src/components/Message/hooks/useRetryHandler.ts b/src/components/Message/hooks/useRetryHandler.ts index 1e370d5b79..caf6f405d0 100644 --- a/src/components/Message/hooks/useRetryHandler.ts +++ b/src/components/Message/hooks/useRetryHandler.ts @@ -3,13 +3,12 @@ import { RetrySendMessage, useChannelActionContext } from '../../../context/Chan import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useRetryHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( customRetrySendMessage?: RetrySendMessage, ): RetrySendMessage => { - const { retrySendMessage: contextRetrySendMessage } = useChannelActionContext( - 'useRetryHandler', - ); + const { retrySendMessage: contextRetrySendMessage } = + useChannelActionContext('useRetryHandler'); const retrySendMessage = customRetrySendMessage || contextRetrySendMessage; diff --git a/src/components/Message/hooks/useUserHandler.ts b/src/components/Message/hooks/useUserHandler.ts index 5ed24b355a..debb5b2371 100644 --- a/src/components/Message/hooks/useUserHandler.ts +++ b/src/components/Message/hooks/useUserHandler.ts @@ -7,11 +7,11 @@ import type { StreamMessage } from '../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export type UserEventHandler< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (event: React.BaseSyntheticEvent, user: User) => void; export const useUserHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: StreamMessage, eventHandlers?: { diff --git a/src/components/Message/hooks/useUserRole.ts b/src/components/Message/hooks/useUserRole.ts index b4077b6d53..b4d058939f 100644 --- a/src/components/Message/hooks/useUserRole.ts +++ b/src/components/Message/hooks/useUserRole.ts @@ -4,15 +4,14 @@ import { useChatContext } from '../../../context/ChatContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export const useUserRole = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: StreamMessage, onlySenderCanEdit?: boolean, disableQuotedMessages?: boolean, ) => { - const { channel, channelCapabilities = {} } = useChannelStateContext( - 'useUserRole', - ); + const { channel, channelCapabilities = {} } = + useChannelStateContext('useUserRole'); const { client } = useChatContext('useUserRole'); /** diff --git a/src/components/Message/icons.tsx b/src/components/Message/icons.tsx index 311b56a69a..18c89a2931 100644 --- a/src/components/Message/icons.tsx +++ b/src/components/Message/icons.tsx @@ -53,7 +53,7 @@ export const PinIcon = () => ( ); export const PinIndicator = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ message, t, diff --git a/src/components/Message/renderText/componentRenderers/Mention.tsx b/src/components/Message/renderText/componentRenderers/Mention.tsx index b5dd659fc1..06fb7f6c93 100644 --- a/src/components/Message/renderText/componentRenderers/Mention.tsx +++ b/src/components/Message/renderText/componentRenderers/Mention.tsx @@ -4,7 +4,7 @@ import type { UserResponse } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export type MentionProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = PropsWithChildren<{ node: { mentionedUser: UserResponse; @@ -12,7 +12,7 @@ export type MentionProps< }>; export const Mention = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, node: { mentionedUser }, diff --git a/src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts b/src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts index 55ffd7e828..ff942708c1 100644 --- a/src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts +++ b/src/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.ts @@ -8,65 +8,65 @@ import type { Element } from 'react-markdown/lib/ast-to-react'; import type { UserResponse } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../../types'; -export const mentionsMarkdownPlugin = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics ->( - mentioned_users: UserResponse[], -) => () => { - const mentioned_usernames = mentioned_users - .map((user) => user.name || user.id) - .filter(Boolean) - .map(escapeRegExp); +export const mentionsMarkdownPlugin = + ( + mentioned_users: UserResponse[], + ) => + () => { + const mentioned_usernames = mentioned_users + .map((user) => user.name || user.id) + .filter(Boolean) + .map(escapeRegExp); - const mentionedUsersRegex = new RegExp( - mentioned_usernames.map((username) => `@${username}`).join('|'), - 'g', - ); - - const replace: ReplaceFunction = (match) => { - const usernameOrId = match.replace('@', ''); - const user = mentioned_users.find( - ({ id, name }) => name === usernameOrId || id === usernameOrId, + const mentionedUsersRegex = new RegExp( + mentioned_usernames.map((username) => `@${username}`).join('|'), + 'g', ); - return u('element', { mentionedUser: user, properties: {}, tagName: 'mention' }, [ - u('text', match), - ]); - }; - const transform = (tree: Nodes) => { - if (!mentioned_usernames.length) return; + const replace: ReplaceFunction = (match) => { + const usernameOrId = match.replace('@', ''); + const user = mentioned_users.find( + ({ id, name }) => name === usernameOrId || id === usernameOrId, + ); + return u('element', { mentionedUser: user, properties: {}, tagName: 'mention' }, [ + u('text', match), + ]); + }; - // handles special cases of mentions where user.name is an e-mail - // Remark GFM translates all e-mail-like text nodes to links creating - // two separate child nodes "@" and "your.name@as.email" instead of - // keeping it as one text node with value "@your.name@as.email" - // this piece finds these two separated nodes and merges them together - // before "replace" function takes over - visit(tree, (node, index, parent) => { - if (typeof index === 'undefined') return; - if (!parent) return; + const transform = (tree: Nodes) => { + if (!mentioned_usernames.length) return; - const nextChild = parent.children.at(index + 1) as Element; - const nextChildHref = nextChild?.properties?.href as string | undefined; + // handles special cases of mentions where user.name is an e-mail + // Remark GFM translates all e-mail-like text nodes to links creating + // two separate child nodes "@" and "your.name@as.email" instead of + // keeping it as one text node with value "@your.name@as.email" + // this piece finds these two separated nodes and merges them together + // before "replace" function takes over + visit(tree, (node, index, parent) => { + if (typeof index === 'undefined') return; + if (!parent) return; - if ( - node.type === 'text' && - // text value has to have @ sign at the end of the string - // and no other characters except whitespace can precede it - // valid cases: "text @", "@", " @" - // invalid cases: "text@", "@text", - /.?\s?@$|^@$/.test(node.value) && - nextChildHref?.startsWith('mailto:') - ) { - const newTextValue = node.value.replace(/@$/, ''); - const username = nextChildHref.replace('mailto:', ''); - parent.children[index] = u('text', newTextValue); - parent.children[index + 1] = u('text', `@${username}`); - } - }); + const nextChild = parent.children.at(index + 1) as Element; + const nextChildHref = nextChild?.properties?.href as string | undefined; - findAndReplace(tree, [mentionedUsersRegex, replace]); - }; + if ( + node.type === 'text' && + // text value has to have @ sign at the end of the string + // and no other characters except whitespace can precede it + // valid cases: "text @", "@", " @" + // invalid cases: "text@", "@text", + /.?\s?@$|^@$/.test(node.value) && + nextChildHref?.startsWith('mailto:') + ) { + const newTextValue = node.value.replace(/@$/, ''); + const username = nextChildHref.replace('mailto:', ''); + parent.children[index] = u('text', newTextValue); + parent.children[index + 1] = u('text', `@${username}`); + } + }); - return transform; -}; + findAndReplace(tree, [mentionedUsersRegex, replace]); + }; + + return transform; + }; diff --git a/src/components/Message/renderText/renderText.tsx b/src/components/Message/renderText/renderText.tsx index e8859b5f2e..396f62f2a2 100644 --- a/src/components/Message/renderText/renderText.tsx +++ b/src/components/Message/renderText/renderText.tsx @@ -71,7 +71,7 @@ export const markDownRenderers: RenderTextOptions['customMarkDownRenderers'] = { }; export type RenderTextOptions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { allowedTagNames?: Array; customMarkDownRenderers?: Options['components'] & @@ -84,7 +84,7 @@ export type RenderTextOptions< }; export const renderText = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( text?: string, mentionedUsers?: UserResponse[], diff --git a/src/components/Message/types.ts b/src/components/Message/types.ts index 961c92c192..9cc82632ed 100644 --- a/src/components/Message/types.ts +++ b/src/components/Message/types.ts @@ -20,7 +20,7 @@ export type ReactEventHandler = (event: React.BaseSyntheticEvent) => Promise = { /** The message object */ message: StreamMessage; @@ -113,11 +113,11 @@ export type MessageProps< }; export type MessageUIComponentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial>; export type PinIndicatorProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { message?: StreamMessage; t?: TFunction; diff --git a/src/components/MessageActions/CustomMessageActionsList.tsx b/src/components/MessageActions/CustomMessageActionsList.tsx index 258e346b76..15d4fd9c42 100644 --- a/src/components/MessageActions/CustomMessageActionsList.tsx +++ b/src/components/MessageActions/CustomMessageActionsList.tsx @@ -6,14 +6,14 @@ import type { StreamMessage } from '../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type CustomMessageActionsListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { message: StreamMessage; customMessageActions?: CustomMessageActions; }; export const CustomMessageActionsList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: CustomMessageActionsListProps, ) => { diff --git a/src/components/MessageActions/MessageActions.tsx b/src/components/MessageActions/MessageActions.tsx index b6ccbc6b5c..df080286f9 100644 --- a/src/components/MessageActions/MessageActions.tsx +++ b/src/components/MessageActions/MessageActions.tsx @@ -23,7 +23,7 @@ type MessageContextPropsToPick = | 'message'; export type MessageActionsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial, MessageContextPropsToPick>> & { /* Custom component rendering the icon used in message actions button. This button invokes the message actions menu. */ ActionsIcon?: React.ComponentType; @@ -36,7 +36,7 @@ export type MessageActionsProps< }; export const MessageActions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageActionsProps, ) => { diff --git a/src/components/MessageActions/MessageActionsBox.tsx b/src/components/MessageActions/MessageActionsBox.tsx index e7deb75ec0..b17d2836b0 100644 --- a/src/components/MessageActions/MessageActionsBox.tsx +++ b/src/components/MessageActions/MessageActionsBox.tsx @@ -25,7 +25,7 @@ type PropsDrilledToMessageActionsBox = | 'handlePin'; export type MessageActionsBoxProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Pick, PropsDrilledToMessageActionsBox> & { isUserMuted: () => boolean; mine: boolean; @@ -33,7 +33,7 @@ export type MessageActionsBoxProps< } & ComponentProps<'div'>; const UnMemoizedMessageActionsBox = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageActionsBoxProps, ) => { @@ -52,13 +52,11 @@ const UnMemoizedMessageActionsBox = < ...restDivProps } = props; - const { - CustomMessageActionsList = DefaultCustomMessageActionsList, - } = useComponentContext('MessageActionsBox'); + const { CustomMessageActionsList = DefaultCustomMessageActionsList } = + useComponentContext('MessageActionsBox'); const { setQuotedMessage } = useChannelActionContext('MessageActionsBox'); - const { customMessageActions, message, threadList } = useMessageContext( - 'MessageActionsBox', - ); + const { customMessageActions, message, threadList } = + useMessageContext('MessageActionsBox'); const { t } = useTranslationContext('MessageActionsBox'); diff --git a/src/components/MessageActions/__tests__/MessageActionsBox.test.js b/src/components/MessageActions/__tests__/MessageActionsBox.test.js index f4b57fff98..21fdf8adde 100644 --- a/src/components/MessageActions/__tests__/MessageActionsBox.test.js +++ b/src/components/MessageActions/__tests__/MessageActionsBox.test.js @@ -408,13 +408,13 @@ describe('MessageActionsBox', () => { }); await toggleOpenMessageActions(0); let boxes = screen.getAllByTestId('message-actions-box'); - + expect(boxes).toHaveLength(1); expect(boxes[0]).toHaveTextContent(ACTION_TEXT); await toggleOpenMessageActions(1); boxes = screen.getAllByTestId('message-actions-box'); - + expect(boxes).toHaveLength(1); expect(boxes[0]).toHaveTextContent(ACTION_TEXT); }); diff --git a/src/components/MessageBounce/MessageBouncePrompt.tsx b/src/components/MessageBounce/MessageBouncePrompt.tsx index 805dcb156f..efed017567 100644 --- a/src/components/MessageBounce/MessageBouncePrompt.tsx +++ b/src/components/MessageBounce/MessageBouncePrompt.tsx @@ -8,11 +8,10 @@ import type { ModalProps } from '../Modal'; export type MessageBouncePromptProps = PropsWithChildren>; export function MessageBouncePrompt< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, onClose }: MessageBouncePromptProps) { - const { handleDelete, handleEdit, handleRetry } = useMessageBounceContext( - 'MessageBouncePrompt', - ); + const { handleDelete, handleEdit, handleRetry } = + useMessageBounceContext('MessageBouncePrompt'); const { t } = useTranslationContext('MessageBouncePrompt'); function createHandler( diff --git a/src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx b/src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx index 6822449735..8851c4b71a 100644 --- a/src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx +++ b/src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx @@ -29,7 +29,7 @@ import { useMessageInputContext } from '../../../context'; import type { DefaultStreamChatGenerics } from '../../../types'; export type AttachmentPreviewListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { AudioAttachmentPreview?: ComponentType; FileAttachmentPreview?: ComponentType; @@ -42,7 +42,7 @@ export type AttachmentPreviewListProps< }; export const AttachmentPreviewList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ AudioAttachmentPreview = DefaultFilePreview, FileAttachmentPreview = DefaultFilePreview, @@ -51,11 +51,8 @@ export const AttachmentPreviewList = < VideoAttachmentPreview = DefaultFilePreview, VoiceRecordingPreview = DefaultVoiceRecordingPreview, }: AttachmentPreviewListProps) => { - const { - attachments, - removeAttachments, - uploadAttachment, - } = useMessageInputContext('AttachmentPreviewList'); + const { attachments, removeAttachments, uploadAttachment } = + useMessageInputContext('AttachmentPreviewList'); return (
diff --git a/src/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.tsx b/src/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.tsx index 3f7853bbd1..cb0f5d1ee9 100644 --- a/src/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.tsx +++ b/src/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.tsx @@ -16,14 +16,14 @@ type FileLikeAttachment = { export type FileAttachmentPreviewProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = AttachmentPreviewProps< LocalAttachmentCast, StreamChatGenerics >; export const FileAttachmentPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, handleRetry, diff --git a/src/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.tsx b/src/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.tsx index 6c7186933e..758b976d59 100644 --- a/src/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.tsx +++ b/src/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.tsx @@ -9,14 +9,14 @@ import type { DefaultStreamChatGenerics } from '../../../types'; export type ImageAttachmentPreviewProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = AttachmentPreviewProps< LocalImageAttachment, StreamChatGenerics >; export const ImageAttachmentPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, handleRetry, diff --git a/src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx b/src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx index 1f7f12a4dd..dd2635fb81 100644 --- a/src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx +++ b/src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx @@ -8,14 +8,14 @@ import type { DefaultStreamChatGenerics } from '../../../types'; export type UnsupportedAttachmentPreviewProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = AttachmentPreviewProps< AnyLocalAttachment, StreamChatGenerics >; export const UnsupportedAttachmentPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, handleRetry, diff --git a/src/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.tsx b/src/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.tsx index 1a4773d4e1..03e1a9b13b 100644 --- a/src/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.tsx +++ b/src/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.tsx @@ -10,14 +10,14 @@ import type { DefaultStreamChatGenerics } from '../../../types'; export type VoiceRecordingPreviewProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = AttachmentPreviewProps< LocalVoiceRecordingAttachment, StreamChatGenerics >; export const VoiceRecordingPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachment, handleRetry, diff --git a/src/components/MessageInput/AttachmentPreviewList/types.ts b/src/components/MessageInput/AttachmentPreviewList/types.ts index 86ea32514f..f5c398325d 100644 --- a/src/components/MessageInput/AttachmentPreviewList/types.ts +++ b/src/components/MessageInput/AttachmentPreviewList/types.ts @@ -3,7 +3,7 @@ import type { DefaultStreamChatGenerics } from '../../../types'; export type AttachmentPreviewProps< A extends LocalAttachment, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachment: A; handleRetry: ( diff --git a/src/components/MessageInput/AttachmentSelector.tsx b/src/components/MessageInput/AttachmentSelector.tsx index 4203bae2ba..8d5e58931f 100644 --- a/src/components/MessageInput/AttachmentSelector.tsx +++ b/src/components/MessageInput/AttachmentSelector.tsx @@ -21,10 +21,8 @@ import { import type { DefaultStreamChatGenerics } from '../../types'; export const SimpleAttachmentSelector = () => { - const { - AttachmentSelectorInitiationButtonContents, - FileUploadIcon = DefaultUploadIcon, - } = useComponentContext(); + const { AttachmentSelectorInitiationButtonContents, FileUploadIcon = DefaultUploadIcon } = + useComponentContext(); const inputRef = useRef>(null); const [labelElement, setLabelElement] = useState(null); const id = useMemo(() => nanoid(), []); @@ -131,7 +129,7 @@ export type AttachmentSelectorProps = { }; const useAttachmentSelectorActionsFiltered = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( original: AttachmentSelectorAction[], ) => { @@ -158,7 +156,7 @@ const useAttachmentSelectorActionsFiltered = < }; export const AttachmentSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ attachmentSelectorActionSet = defaultAttachmentSelectorActionSet, getModalPortalDestination, diff --git a/src/components/MessageInput/DefaultTriggerProvider.tsx b/src/components/MessageInput/DefaultTriggerProvider.tsx index 71d6ea25c1..25e6965d0a 100644 --- a/src/components/MessageInput/DefaultTriggerProvider.tsx +++ b/src/components/MessageInput/DefaultTriggerProvider.tsx @@ -22,13 +22,13 @@ export type AutocompleteMinimalData = { } & ({ id: string } | { name: string }); export type CommandTriggerSetting< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = TriggerSetting>; export type EmojiTriggerSetting = TriggerSetting; export type UserTriggerSetting< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = TriggerSetting>; export type TriggerSetting = { @@ -38,9 +38,7 @@ export type TriggerSetting text: string, onReady: (data: (U & AutocompleteMinimalData)[], token: string) => void, ) => U[] | PromiseLike | void; - output: ( - entity: U, - ) => + output: (entity: U) => | { caretPosition: 'start' | 'end' | 'next' | number; text: string; @@ -53,7 +51,7 @@ export type TriggerSetting export type TriggerSettings< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = | { [key in keyof V]: TriggerSetting; @@ -66,7 +64,7 @@ export type TriggerSettings< export const DefaultTriggerProvider = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >({ children, }: PropsWithChildren>) => { diff --git a/src/components/MessageInput/DropzoneProvider.tsx b/src/components/MessageInput/DropzoneProvider.tsx index 236cdf44e9..7ff2d9d8a3 100644 --- a/src/components/MessageInput/DropzoneProvider.tsx +++ b/src/components/MessageInput/DropzoneProvider.tsx @@ -17,20 +17,15 @@ import type { CustomTrigger, DefaultStreamChatGenerics, UnknownType } from '../. const DropzoneInner = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >({ children, }: PropsWithChildren) => { - const { acceptedFiles, multipleUploads } = useChannelStateContext( - 'DropzoneProvider', - ); + const { acceptedFiles, multipleUploads } = + useChannelStateContext('DropzoneProvider'); - const { - cooldownRemaining, - isUploadEnabled, - maxFilesLeft, - uploadNewFiles, - } = useMessageInputContext('DropzoneProvider'); + const { cooldownRemaining, isUploadEnabled, maxFilesLeft, uploadNewFiles } = + useMessageInputContext('DropzoneProvider'); return ( ( props: PropsWithChildren>, ) => { diff --git a/src/components/MessageInput/EditMessageForm.tsx b/src/components/MessageInput/EditMessageForm.tsx index 34ad16fee8..c9a093e8c1 100644 --- a/src/components/MessageInput/EditMessageForm.tsx +++ b/src/components/MessageInput/EditMessageForm.tsx @@ -7,7 +7,7 @@ import type { CustomTrigger, DefaultStreamChatGenerics } from '../../types/types export const EditMessageForm = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >() => { const { t } = useTranslationContext('EditMessageForm'); diff --git a/src/components/MessageInput/MessageInput.tsx b/src/components/MessageInput/MessageInput.tsx index ce6a92f2db..9f456dcc01 100644 --- a/src/components/MessageInput/MessageInput.tsx +++ b/src/components/MessageInput/MessageInput.tsx @@ -40,7 +40,7 @@ export interface EmojiSearchIndex { export type MessageInputProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = { /** Additional props to be passed to the underlying `AutoCompleteTextarea` component, [available props](https://www.npmjs.com/package/react-textarea-autosize) */ additionalTextareaProps?: React.TextareaHTMLAttributes; @@ -130,7 +130,7 @@ export type MessageInputProps< const MessageInputProvider = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: PropsWithChildren>, ) => { @@ -154,7 +154,7 @@ const MessageInputProvider = < const UnMemoizedMessageInput = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: MessageInputProps, ) => { diff --git a/src/components/MessageInput/MessageInputFlat.tsx b/src/components/MessageInput/MessageInputFlat.tsx index 3342989360..0b1ee0321a 100644 --- a/src/components/MessageInput/MessageInputFlat.tsx +++ b/src/components/MessageInput/MessageInputFlat.tsx @@ -36,7 +36,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; import { AIStates, useAIState } from '../AIStateIndicator'; export const MessageInputFlat = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { t } = useTranslationContext('MessageInputFlat'); const { @@ -83,10 +83,8 @@ export const MessageInputFlat = < const stopGenerating = useCallback(() => channel?.stopAIResponse(), [channel]); - const [ - showRecordingPermissionDeniedNotification, - setShowRecordingPermissionDeniedNotification, - ] = useState(false); + const [showRecordingPermissionDeniedNotification, setShowRecordingPermissionDeniedNotification] = + useState(false); const closePermissionDeniedNotification = useCallback(() => { setShowRecordingPermissionDeniedNotification(false); }, []); diff --git a/src/components/MessageInput/QuotedMessagePreview.tsx b/src/components/MessageInput/QuotedMessagePreview.tsx index 6f45849fb9..34c66c91cc 100644 --- a/src/components/MessageInput/QuotedMessagePreview.tsx +++ b/src/components/MessageInput/QuotedMessagePreview.tsx @@ -15,7 +15,7 @@ import type { StreamMessage } from '../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export const QuotedMessagePreviewHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { setQuotedMessage } = useChannelActionContext('QuotedMessagePreview'); const { t } = useTranslationContext('QuotedMessagePreview'); @@ -37,21 +37,19 @@ export const QuotedMessagePreviewHeader = < }; export type QuotedMessagePreviewProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { quotedMessage: StreamMessage; }; export const QuotedMessagePreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ quotedMessage, }: QuotedMessagePreviewProps) => { const { client } = useChatContext(); - const { - Attachment = DefaultAttachment, - Avatar = DefaultAvatar, - } = useComponentContext('QuotedMessagePreview'); + const { Attachment = DefaultAttachment, Avatar = DefaultAvatar } = + useComponentContext('QuotedMessagePreview'); const { userLanguage } = useTranslationContext('QuotedMessagePreview'); const quotedMessageText = diff --git a/src/components/MessageInput/SendButton.tsx b/src/components/MessageInput/SendButton.tsx index 38aae95fb8..5355875650 100644 --- a/src/components/MessageInput/SendButton.tsx +++ b/src/components/MessageInput/SendButton.tsx @@ -4,7 +4,7 @@ import { SendIcon } from './icons'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type SendButtonProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { sendMessage: ( event: React.BaseSyntheticEvent, @@ -12,7 +12,7 @@ export type SendButtonProps< ) => void; } & React.ComponentProps<'button'>; export const SendButton = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ sendMessage, ...rest diff --git a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js index 3e8a1ebdfe..53e03b7147 100644 --- a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js +++ b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js @@ -1,5 +1,3 @@ - - import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; diff --git a/src/components/MessageInput/__tests__/LinkPreviewList.test.js b/src/components/MessageInput/__tests__/LinkPreviewList.test.js index 86509beac3..7daf1c1dfa 100644 --- a/src/components/MessageInput/__tests__/LinkPreviewList.test.js +++ b/src/components/MessageInput/__tests__/LinkPreviewList.test.js @@ -25,9 +25,8 @@ import '@testing-library/jest-dom'; // Mock out lodash debounce implementation, so it calls the debounced method immediately jest.mock('lodash.debounce', () => jest.fn((fn) => { - fn.cancel = jest.fn(); - + fn.flush = jest.fn(); return fn; }), @@ -94,40 +93,44 @@ const ChatContextOverrider = ({ children, contextOverrides }) => { return {children}; }; -const makeRenderFn = (InputComponent) => async ({ - messageInputProps = {}, - channelProps = {}, - chatContextOverrides = {}, - client = chatClient, - messageContextOverrides = {}, - messageActionsBoxProps = {}, -} = {}) => { - let renderResult; - await act(() => { - renderResult = render( - - - - - - - - - - - , - ); - }); - const submit = async () => { - const submitButton = renderResult.findByText('Send') || renderResult.findByTitle('Send'); - fireEvent.click(await submitButton); - }; +const makeRenderFn = + (InputComponent) => + async ({ + messageInputProps = {}, + channelProps = {}, + chatContextOverrides = {}, + client = chatClient, + messageContextOverrides = {}, + messageActionsBoxProps = {}, + } = {}) => { + let renderResult; + await act(() => { + renderResult = render( + + + + + + + + + + + , + ); + }); + const submit = async () => { + const submitButton = renderResult.findByText('Send') || renderResult.findByTitle('Send'); + fireEvent.click(await submitButton); + }; - return { submit, ...renderResult }; -}; + return { submit, ...renderResult }; + }; const tearDown = () => { cleanup(); @@ -341,7 +344,7 @@ describe('Link preview', () => { }); }); const linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); }); @@ -384,7 +387,7 @@ describe('Link preview', () => { }); }); let linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); @@ -396,7 +399,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(2); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -409,7 +412,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(3); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -451,7 +454,7 @@ describe('Link preview', () => { await waitFor(() => { const linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(3); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); expect(linkPreviews[1]).toHaveTextContent(scrapedData2.og_scrape_url); @@ -473,7 +476,7 @@ describe('Link preview', () => { }); }); let linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -485,7 +488,7 @@ describe('Link preview', () => { }); }); linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); }); @@ -562,7 +565,7 @@ describe('Link preview', () => { }); }); let linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -574,7 +577,7 @@ describe('Link preview', () => { }); }); linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(0); }); @@ -593,7 +596,7 @@ describe('Link preview', () => { }); }); let linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData.og_scrape_url); @@ -601,7 +604,7 @@ describe('Link preview', () => { fireEvent.click(await screen.findByTestId(LINK_PREVIEW_DISMISS_BTN_TEST_ID)); }); linkPreviews = screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(0); await act(async () => { @@ -830,7 +833,7 @@ describe('Link preview', () => { }); const linkPreviews = await screen.queryAllByTestId(LINK_PREVIEW_TEST_ID); - + expect(linkPreviews).toHaveLength(1); expect(linkPreviews[0]).toHaveTextContent(scrapedData1.og_scrape_url); }); @@ -954,7 +957,7 @@ describe('Link preview', () => { let resolveEnrichURLPromise; jest .spyOn(chatClient, 'enrichURL') - + .mockImplementationOnce(() => new Promise((res) => (resolveEnrichURLPromise = res))); const { submit } = await renderComponent({ @@ -992,7 +995,7 @@ describe('Link preview', () => { let resolveEnrichURLPromise; jest .spyOn(chatClient, 'enrichURL') - + .mockImplementationOnce(() => new Promise((res) => (resolveEnrichURLPromise = res))); const { submit } = await renderComponent({ diff --git a/src/components/MessageInput/__tests__/MessageInput.test.js b/src/components/MessageInput/__tests__/MessageInput.test.js index 94f14c7b23..f90220174d 100644 --- a/src/components/MessageInput/__tests__/MessageInput.test.js +++ b/src/components/MessageInput/__tests__/MessageInput.test.js @@ -111,64 +111,66 @@ function dropFile(file, formElement) { }); } -const makeRenderFn = (InputComponent) => async ({ - channelProps = {}, - channelData = [], - chatContextOverrides = {}, - customChannel, - customClient, - customUser, - messageInputProps = {}, - messageContextOverrides = {}, - messageActionsBoxProps = {}, -} = {}) => { - let channel = customChannel; - let client = customClient; - if (!(channel || client)) { - const result = await initClientWithChannels({ - channelsData: [{ ...mockedChannelData, ...channelData }], - customUser: customUser || user, - }); - channel = result.channels[0]; - client = result.client; - } - let renderResult; - - const defaultMessageInputProps = - InputComponent.name === 'EditMessageForm' ? { message: mainListMessage } : {}; - await act(() => { - renderResult = render( - - - - + async ({ + channelProps = {}, + channelData = [], + chatContextOverrides = {}, + customChannel, + customClient, + customUser, + messageInputProps = {}, + messageContextOverrides = {}, + messageActionsBoxProps = {}, + } = {}) => { + let channel = customChannel; + let client = customClient; + if (!(channel || client)) { + const result = await initClientWithChannels({ + channelsData: [{ ...mockedChannelData, ...channelData }], + customUser: customUser || user, + }); + channel = result.channels[0]; + client = result.client; + } + let renderResult; + + const defaultMessageInputProps = + InputComponent.name === 'EditMessageForm' ? { message: mainListMessage } : {}; + await act(() => { + renderResult = render( + + + + + + - - - - , - ); - }); + + , + ); + }); - const submit = async () => { - const submitButton = - renderResult.queryByTestId(SEND_BTN_EDIT_FORM_TEST_ID) || - renderResult.findByText('Send') || - renderResult.findByTitle('Send'); - fireEvent.click(await submitButton); - }; + const submit = async () => { + const submitButton = + renderResult.queryByTestId(SEND_BTN_EDIT_FORM_TEST_ID) || + renderResult.findByText('Send') || + renderResult.findByTitle('Send'); + fireEvent.click(await submitButton); + }; - return { channel, client, submit, ...renderResult }; -}; + return { channel, client, submit, ...renderResult }; + }; const tearDown = () => { cleanup(); @@ -957,7 +959,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for image uploading to complete before trying to send the message - + await waitFor(() => expect(doImageUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1001,7 +1003,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for file uploading to complete before trying to send the message - + await waitFor(() => expect(doFileUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1047,7 +1049,7 @@ function axeNoViolations(container) { act(() => dropFile(file, formElement)); // wait for file uploading to complete before trying to send the message - + await waitFor(() => expect(doFileUploadRequest).toHaveBeenCalled()); await act(() => submit()); @@ -1395,9 +1397,7 @@ function axeNoViolations(container) { }); if (componentName !== 'EditMessageForm') { - await waitFor( - () => expect(screen.getByTestId('suggestion-list')).toBeInTheDocument(), - ); + await waitFor(() => expect(screen.getByTestId('suggestion-list')).toBeInTheDocument()); const results = await axe(container); expect(results).toHaveNoViolations(); } diff --git a/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js b/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js index eea7c66a92..7245683e6f 100644 --- a/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js +++ b/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js @@ -205,7 +205,7 @@ describe('useMessageInputState', () => { file: { name: type === 'image' ? data.fallback : data.title, type: - type === 'image' ? 'image/' + data.fallback.split('.')[1] : data.mime_type ?? '', + type === 'image' ? 'image/' + data.fallback.split('.')[1] : (data.mime_type ?? ''), }, }; const attachment = { @@ -433,9 +433,8 @@ describe('useMessageInputState', () => { props: scenario === 'custom' ? { - [type === 'image' - ? 'doImageUploadRequest' - : 'doFileUploadRequest']: customSendSpy, + [type === 'image' ? 'doImageUploadRequest' : 'doFileUploadRequest']: + customSendSpy, } : {}, }); diff --git a/src/components/MessageInput/hooks/useAttachments.ts b/src/components/MessageInput/hooks/useAttachments.ts index a9e279fb77..0c9576b5d8 100644 --- a/src/components/MessageInput/hooks/useAttachments.ts +++ b/src/components/MessageInput/hooks/useAttachments.ts @@ -38,7 +38,7 @@ const getAttachmentTypeFromMime = (mimeType: string) => { }; const ensureIsLocalAttachment = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( attachment: Attachment | LocalAttachment, ): LocalAttachment => { @@ -57,7 +57,7 @@ const ensureIsLocalAttachment = < export const useAttachments = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: MessageInputProps, state: MessageInputState, @@ -68,9 +68,8 @@ export const useAttachments = < const { getAppSettings } = useChatContext('useAttachments'); const { t } = useTranslationContext('useAttachments'); const { addNotification } = useChannelActionContext('useAttachments'); - const { channel, maxNumberOfFiles, multipleUploads } = useChannelStateContext( - 'useAttachments', - ); + const { channel, maxNumberOfFiles, multipleUploads } = + useChannelStateContext('useAttachments'); // Number of files that the user can still add. Should never be more than the amount allowed by the API. // If multipleUploads is false, we only want to allow a single upload. diff --git a/src/components/MessageInput/hooks/useCommandTrigger.ts b/src/components/MessageInput/hooks/useCommandTrigger.ts index c87eff808e..3f0ed47891 100644 --- a/src/components/MessageInput/hooks/useCommandTrigger.ts +++ b/src/components/MessageInput/hooks/useCommandTrigger.ts @@ -10,12 +10,12 @@ import type { CommandTriggerSetting } from '../DefaultTriggerProvider'; import type { DefaultStreamChatGenerics } from '../../../types/types'; type ValidCommand< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Required, 'name'>> & Omit, 'name'>; export const useCommandTrigger = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(): CommandTriggerSetting => { const { channelConfig } = useChannelStateContext('useCommandTrigger'); const { t } = useTranslationContext('useCommandTrigger'); diff --git a/src/components/MessageInput/hooks/useCooldownTimer.tsx b/src/components/MessageInput/hooks/useCooldownTimer.tsx index a86207ee3d..728e50d527 100644 --- a/src/components/MessageInput/hooks/useCooldownTimer.tsx +++ b/src/components/MessageInput/hooks/useCooldownTimer.tsx @@ -12,11 +12,10 @@ export type CooldownTimerState = { }; export const useCooldownTimer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(): CooldownTimerState => { - const { client, latestMessageDatesByChannels } = useChatContext( - 'useCooldownTimer', - ); + const { client, latestMessageDatesByChannels } = + useChatContext('useCooldownTimer'); const { channel, messages = [] } = useChannelStateContext('useCooldownTimer'); const [cooldownRemaining, setCooldownRemaining] = useState(); diff --git a/src/components/MessageInput/hooks/useCreateMessageInputContext.ts b/src/components/MessageInput/hooks/useCreateMessageInputContext.ts index 60f09df242..8fa3576bae 100644 --- a/src/components/MessageInput/hooks/useCreateMessageInputContext.ts +++ b/src/components/MessageInput/hooks/useCreateMessageInputContext.ts @@ -5,7 +5,7 @@ import type { CustomTrigger, DefaultStreamChatGenerics } from '../../../types/ty export const useCreateMessageInputContext = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( value: MessageInputContextValue, ) => { diff --git a/src/components/MessageInput/hooks/useLinkPreviews.ts b/src/components/MessageInput/hooks/useLinkPreviews.ts index 9113888d0d..d9dba6c4b0 100644 --- a/src/components/MessageInput/hooks/useLinkPreviews.ts +++ b/src/components/MessageInput/hooks/useLinkPreviews.ts @@ -20,7 +20,7 @@ export type URLEnrichmentConfig = { }; type UseEnrichURLsParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = URLEnrichmentConfig & { dispatch: Dispatch>; linkPreviews: MessageInputState['linkPreviews']; @@ -36,7 +36,7 @@ export type EnrichURLsController = { }; export const useLinkPreviews = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ debounceURLEnrichmentMs: debounceURLEnrichmentMsInputContext, dispatch, @@ -138,7 +138,7 @@ export const useLinkPreviews = < enqueuedLinks.forEach((linkPreview) => { client .enrichURL(linkPreview.og_scrape_url) - + .then(({ duration, ...ogAttachment }) => { if (shouldDiscardEnrichQueries.current) return; diff --git a/src/components/MessageInput/hooks/useMessageInputState.ts b/src/components/MessageInput/hooks/useMessageInputState.ts index 5c95f6c774..49730ef89a 100644 --- a/src/components/MessageInput/hooks/useMessageInputState.ts +++ b/src/components/MessageInput/hooks/useMessageInputState.ts @@ -23,7 +23,7 @@ import type { import { mergeDeep } from '../../../utils/mergeDeep'; export type MessageInputState< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachments: LocalAttachment[]; linkPreviews: LinkPreviewMap; @@ -33,7 +33,7 @@ export type MessageInputState< }; type UpsertAttachmentsAction< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachments: LocalAttachment[]; type: 'upsertAttachments'; @@ -60,14 +60,14 @@ type SetLinkPreviewsAction = { }; type AddMentionedUserAction< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { type: 'addMentionedUser'; user: UserResponse; }; export type MessageInputReducerAction< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = | SetTextAction | ClearAction @@ -77,7 +77,7 @@ export type MessageInputReducerAction< | RemoveAttachmentsAction; export type MessageInputHookProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = EnrichURLsController & { handleChange: React.ChangeEventHandler; handleSubmit: ( @@ -104,7 +104,7 @@ export type MessageInputHookProps< }; const makeEmptyMessageInputState = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(): MessageInputState => ({ attachments: [], linkPreviews: new Map(), @@ -117,7 +117,7 @@ const makeEmptyMessageInputState = < * Initializes the state. Empty if the message prop is falsy. */ const initState = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message?: Pick, 'attachments' | 'mentioned_users' | 'text'>, ): MessageInputState => { @@ -143,7 +143,7 @@ const initState = < ({ ...att, localMetadata: { id: nanoid() }, - } as LocalAttachment), + }) as LocalAttachment, ) || []; const mentioned_users: StreamMessage['mentioned_users'] = message.mentioned_users || []; @@ -161,7 +161,7 @@ const initState = < * MessageInput state reducer */ const messageInputReducer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( state: MessageInputState, action: MessageInputReducerAction, @@ -265,7 +265,7 @@ export type MentionsListState = { */ export const useMessageInputState = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: MessageInputProps, ): MessageInputState & @@ -282,10 +282,8 @@ export const useMessageInputState = < urlEnrichmentConfig, } = props; - const { - channelCapabilities = {}, - enrichURLForPreview: enrichURLForPreviewChannelContext, - } = useChannelStateContext('useMessageInputState'); + const { channelCapabilities = {}, enrichURLForPreview: enrichURLForPreviewChannelContext } = + useChannelStateContext('useMessageInputState'); const defaultValue = getDefaultValue?.() || additionalTextareaProps?.defaultValue; const initialStateValue = diff --git a/src/components/MessageInput/hooks/useMessageInputText.ts b/src/components/MessageInput/hooks/useMessageInputText.ts index e39842e03d..abd9258f34 100644 --- a/src/components/MessageInput/hooks/useMessageInputText.ts +++ b/src/components/MessageInput/hooks/useMessageInputText.ts @@ -9,7 +9,7 @@ import type { EnrichURLsController } from './useLinkPreviews'; export const useMessageInputText = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: MessageInputProps, state: MessageInputState, diff --git a/src/components/MessageInput/hooks/useSubmitHandler.ts b/src/components/MessageInput/hooks/useSubmitHandler.ts index 728cdb85fe..5eae76b473 100644 --- a/src/components/MessageInput/hooks/useSubmitHandler.ts +++ b/src/components/MessageInput/hooks/useSubmitHandler.ts @@ -18,7 +18,7 @@ import type { EnrichURLsController } from './useLinkPreviews'; export const useSubmitHandler = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: MessageInputProps, state: MessageInputState, @@ -32,9 +32,8 @@ export const useSubmitHandler = < const { cancelURLEnrichment, findAndEnqueueURLsToEnrich } = enrichURLsController; const { channel } = useChannelStateContext('useSubmitHandler'); - const { addNotification, editMessage, sendMessage } = useChannelActionContext( - 'useSubmitHandler', - ); + const { addNotification, editMessage, sendMessage } = + useChannelActionContext('useSubmitHandler'); const { t } = useTranslationContext('useSubmitHandler'); const textReference = useRef({ hasChanged: false, initialText: text }); @@ -113,7 +112,7 @@ export const useSubmitHandler = < (attFromUpload) => attFromUpload.og_scrape_url === linkPreview.og_scrape_url, ), ) - + .map(({ state: linkPreviewState, ...ogAttachment }) => ogAttachment as Attachment); // scraped attachments are added only if all enrich queries has completed. Otherwise, the scraping has to be done server-side. @@ -146,11 +145,11 @@ export const useSubmitHandler = < try { await editMessage( - ({ + { ...message, ...updatedMessage, ...customMessageData, - } as unknown) as UpdatedMessage, + } as unknown as UpdatedMessage, sendOptions, ); diff --git a/src/components/MessageInput/hooks/useUserTrigger.ts b/src/components/MessageInput/hooks/useUserTrigger.ts index e5e13bd917..8425c90375 100644 --- a/src/components/MessageInput/hooks/useUserTrigger.ts +++ b/src/components/MessageInput/hooks/useUserTrigger.ts @@ -16,7 +16,7 @@ import type { UserTriggerSetting } from '../../MessageInput/DefaultTriggerProvid import type { DefaultStreamChatGenerics } from '../../../types/types'; export type UserTriggerParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { onSelectUser: (item: UserResponse) => void; disableMentions?: boolean; @@ -26,7 +26,7 @@ export type UserTriggerParams< }; export const useUserTrigger = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: UserTriggerParams, ): UserTriggerSetting => { diff --git a/src/components/MessageInput/hooks/utils.ts b/src/components/MessageInput/hooks/utils.ts index 84917dcd65..56567fc101 100644 --- a/src/components/MessageInput/hooks/utils.ts +++ b/src/components/MessageInput/hooks/utils.ts @@ -60,7 +60,7 @@ export const calculateLevenshtein = (query: string, name: string) => { }; export type SearchLocalUserParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { ownUserId: string | undefined; query: string; @@ -70,7 +70,7 @@ export type SearchLocalUserParams< }; export const searchLocalUsers = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: SearchLocalUserParams, ): UserResponse[] => { @@ -113,7 +113,7 @@ export const searchLocalUsers = < }; type CheckUploadPermissionsParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { addNotification: ChannelActionContextValue['addNotification']; file: File; @@ -123,7 +123,7 @@ type CheckUploadPermissionsParams< }; export const checkUploadPermissions = async < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: CheckUploadPermissionsParams, ) => { diff --git a/src/components/MessageInput/types.ts b/src/components/MessageInput/types.ts index b9b2a77f24..f332e06b1d 100644 --- a/src/components/MessageInput/types.ts +++ b/src/components/MessageInput/types.ts @@ -31,7 +31,7 @@ export enum SetLinkPreviewMode { export type LinkPreviewMap = Map; export type VoiceRecordingAttachment< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics + StreamChatGenerics extends ExtendableGenerics = DefaultGenerics, > = Attachment & { asset_url: string; type: 'voiceRecording'; @@ -42,45 +42,41 @@ export type VoiceRecordingAttachment< waveform_data?: Array; }; -type FileAttachment< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics -> = Attachment & { - type: 'file'; - asset_url?: string; - file_size?: number; - mime_type?: string; - title?: string; -}; - -export type AudioAttachment< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics -> = Attachment & { - type: 'audio'; - asset_url?: string; - file_size?: number; - mime_type?: string; - title?: string; -}; - -export type VideoAttachment< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics -> = Attachment & { - type: 'video'; - asset_url?: string; - mime_type?: string; - thumb_url?: string; - title?: string; -}; - -type ImageAttachment< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics -> = Attachment & { - type: 'image'; - fallback?: string; - image_url?: string; - original_height?: number; - original_width?: number; -}; +type FileAttachment = + Attachment & { + type: 'file'; + asset_url?: string; + file_size?: number; + mime_type?: string; + title?: string; + }; + +export type AudioAttachment = + Attachment & { + type: 'audio'; + asset_url?: string; + file_size?: number; + mime_type?: string; + title?: string; + }; + +export type VideoAttachment = + Attachment & { + type: 'video'; + asset_url?: string; + mime_type?: string; + thumb_url?: string; + title?: string; + }; + +type ImageAttachment = + Attachment & { + type: 'image'; + fallback?: string; + image_url?: string; + original_height?: number; + original_width?: number; + }; export type BaseLocalAttachmentMetadata = { id: string; @@ -99,13 +95,12 @@ export type LocalAttachmentCast> = A & { localMetadata: L & BaseLocalAttachmentMetadata; }; -export type LocalAttachmentMetadata< - CustomLocalMetadata = Record -> = CustomLocalMetadata & BaseLocalAttachmentMetadata & LocalImageAttachmentUploadMetadata; +export type LocalAttachmentMetadata> = + CustomLocalMetadata & BaseLocalAttachmentMetadata & LocalImageAttachmentUploadMetadata; export type LocalVoiceRecordingAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< VoiceRecordingAttachment, LocalAttachmentUploadMetadata & CustomLocalMetadata @@ -113,7 +108,7 @@ export type LocalVoiceRecordingAttachment< export type LocalAudioAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< AudioAttachment, LocalAttachmentUploadMetadata & CustomLocalMetadata @@ -121,7 +116,7 @@ export type LocalAudioAttachment< export type LocalVideoAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< VideoAttachment, LocalAttachmentUploadMetadata & CustomLocalMetadata @@ -129,7 +124,7 @@ export type LocalVideoAttachment< export type LocalImageAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< ImageAttachment, LocalImageAttachmentUploadMetadata & CustomLocalMetadata @@ -137,7 +132,7 @@ export type LocalImageAttachment< export type LocalFileAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< FileAttachment, LocalAttachmentUploadMetadata & CustomLocalMetadata @@ -145,14 +140,14 @@ export type LocalFileAttachment< export type AnyLocalAttachment< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = LocalAttachmentCast< Attachment, LocalAttachmentMetadata >; export type LocalAttachment< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = | AnyLocalAttachment | LocalFileAttachment @@ -163,7 +158,7 @@ export type LocalAttachment< export type LocalAttachmentToUpload< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - CustomLocalMetadata = Record + CustomLocalMetadata = Record, > = Partial> & { localMetadata: Partial & LocalAttachmentUploadMetadata & diff --git a/src/components/MessageList/ConnectionStatus.tsx b/src/components/MessageList/ConnectionStatus.tsx index 8099baa626..c2746951a3 100644 --- a/src/components/MessageList/ConnectionStatus.tsx +++ b/src/components/MessageList/ConnectionStatus.tsx @@ -7,7 +7,7 @@ import { useChatContext, useTranslationContext } from '../../context'; import type { DefaultStreamChatGenerics } from '../../types/types'; const UnMemoizedConnectionStatus = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { client } = useChatContext('ConnectionStatus'); const { t } = useTranslationContext('ConnectionStatus'); diff --git a/src/components/MessageList/GiphyPreviewMessage.tsx b/src/components/MessageList/GiphyPreviewMessage.tsx index 66ae87b349..91f0ad4b5d 100644 --- a/src/components/MessageList/GiphyPreviewMessage.tsx +++ b/src/components/MessageList/GiphyPreviewMessage.tsx @@ -6,13 +6,13 @@ import type { StreamMessage } from '../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type GiphyPreviewMessageProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { message: StreamMessage; }; export const GiphyPreviewMessage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: GiphyPreviewMessageProps, ) => { diff --git a/src/components/MessageList/MessageList.tsx b/src/components/MessageList/MessageList.tsx index e2012383e0..ed41227981 100644 --- a/src/components/MessageList/MessageList.tsx +++ b/src/components/MessageList/MessageList.tsx @@ -46,12 +46,12 @@ import { } from '../../constants/limits'; type MessageListWithContextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, 'members' | 'mutes' | 'watchers'> & MessageListProps; const MessageListWithContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageListWithContextProps, ) => { @@ -107,20 +107,15 @@ const MessageListWithContext = < MessageListMainPanel = DefaultMessageListMainPanel, } = useComponentContext('MessageList'); - const { - hasNewMessages, - isMessageListScrolledToBottom, - onScroll, - scrollToBottom, - wrapperRect, - } = useScrollLocationLogic({ - hasMoreNewer, - listElement, - loadMoreScrollThreshold, - messages, - scrolledUpThreshold: props.scrolledUpThreshold, - suppressAutoscroll, - }); + const { hasNewMessages, isMessageListScrolledToBottom, onScroll, scrollToBottom, wrapperRect } = + useScrollLocationLogic({ + hasMoreNewer, + listElement, + loadMoreScrollThreshold, + messages, + scrolledUpThreshold: props.scrolledUpThreshold, + suppressAutoscroll, + }); const { show: showUnreadMessagesNotification } = useUnreadMessagesNotification({ isMessageListScrolledToBottom, @@ -313,7 +308,7 @@ type PropsDrilledToMessage = | 'unsafeHTML'; export type MessageListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial, PropsDrilledToMessage>> & { /** Disables the injection of date separator components in MessageList, defaults to `false` */ disableDateSeparator?: boolean; @@ -389,20 +384,17 @@ export type MessageListProps< * - [TypingContext](https://getstream.io/chat/docs/sdk/react/contexts/typing_context/) */ export const MessageList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageListProps, ) => { - const { - jumpToLatestMessage, - loadMore, - loadMoreNewer, - } = useChannelActionContext('MessageList'); + const { jumpToLatestMessage, loadMore, loadMoreNewer } = + useChannelActionContext('MessageList'); const { - members: membersPropToNotPass, - mutes: mutesPropToNotPass, - watchers: watchersPropToNotPass, + members: membersPropToNotPass, + mutes: mutesPropToNotPass, + watchers: watchersPropToNotPass, ...restChannelStateContext } = useChannelStateContext('MessageList'); diff --git a/src/components/MessageList/MessageListMainPanel.tsx b/src/components/MessageList/MessageListMainPanel.tsx index 8dd72069ac..3c2635ac16 100644 --- a/src/components/MessageList/MessageListMainPanel.tsx +++ b/src/components/MessageList/MessageListMainPanel.tsx @@ -1,7 +1,8 @@ import React from 'react'; import type { PropsWithChildrenOnly } from '../../types/types'; -export const MESSAGE_LIST_MAIN_PANEL_CLASS = 'str-chat__main-panel-inner str-chat__message-list-main-panel' as const; +export const MESSAGE_LIST_MAIN_PANEL_CLASS = + 'str-chat__main-panel-inner str-chat__message-list-main-panel' as const; export const MessageListMainPanel = ({ children }: PropsWithChildrenOnly) => (
{children}
diff --git a/src/components/MessageList/VirtualizedMessageList.tsx b/src/components/MessageList/VirtualizedMessageList.tsx index 897819525d..0ab4291087 100644 --- a/src/components/MessageList/VirtualizedMessageList.tsx +++ b/src/components/MessageList/VirtualizedMessageList.tsx @@ -89,7 +89,7 @@ type VirtualizedMessageListPropsForContext = * Context object provided to some Virtuoso props that are functions (components rendered by Virtuoso and other functions) */ export type VirtuosoContext< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Required< Pick< ComponentContextValue, @@ -123,7 +123,7 @@ export type VirtuosoContext< }; type VirtualizedMessageListWithContextProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = VirtualizedMessageListProps & { channel: Channel; hasMore: boolean; @@ -175,7 +175,7 @@ function calculateInitialTopMostItemIndex( } const VirtualizedMessageListWithContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: VirtualizedMessageListWithContextProps, ) => { @@ -225,10 +225,8 @@ const VirtualizedMessageListWithContext = < threadList, } = props; - const { - components: virtuosoComponentsFromProps, - ...overridingVirtuosoProps - } = additionalVirtuosoProps; + const { components: virtuosoComponentsFromProps, ...overridingVirtuosoProps } = + additionalVirtuosoProps; // Stops errors generated from react-virtuoso to bubble up // to Sentry or other tracking tools. @@ -254,18 +252,15 @@ const VirtualizedMessageListWithContext = < const lastRead = useMemo(() => channel.lastRead?.(), [channel]); - const { - show: showUnreadMessagesNotification, - toggleShowUnreadMessagesNotification, - } = useUnreadMessagesNotificationVirtualized({ - lastRead: channelUnreadUiState?.last_read, - showAlways: !!showUnreadNotificationAlways, - unreadCount: channelUnreadUiState?.unread_messages ?? 0, - }); + const { show: showUnreadMessagesNotification, toggleShowUnreadMessagesNotification } = + useUnreadMessagesNotificationVirtualized({ + lastRead: channelUnreadUiState?.last_read, + showAlways: !!showUnreadNotificationAlways, + unreadCount: channelUnreadUiState?.unread_messages ?? 0, + }); - const { giphyPreviewMessage, setGiphyPreviewMessage } = useGiphyPreview( - separateGiphyPreview, - ); + const { giphyPreviewMessage, setGiphyPreviewMessage } = + useGiphyPreview(separateGiphyPreview); const processedMessages = useMemo(() => { if (typeof messages === 'undefined') { @@ -310,9 +305,10 @@ const VirtualizedMessageListWithContext = < userID: client.userID, }); - const lastReceivedMessageId = useMemo(() => getLastReceived(processedMessages), [ - processedMessages, - ]); + const lastReceivedMessageId = useMemo( + () => getLastReceived(processedMessages), + [processedMessages], + ); const groupStylesFn = groupStyles || getGroupStyles; const messageGroupStyles = useMemo( @@ -529,7 +525,7 @@ const VirtualizedMessageListWithContext = < }; export type VirtualizedMessageListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial, PropsDrilledToMessage>> & { /** Additional props to be passed the underlying [`react-virtuoso` virtualized list dependency](https://virtuoso.dev/virtuoso-api-reference/) */ additionalVirtuosoProps?: VirtuosoProps>; @@ -639,13 +635,10 @@ export type VirtualizedMessageListProps< * It is a consumer of the React contexts set in [Channel](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Channel/Channel.tsx). */ export function VirtualizedMessageList< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(props: VirtualizedMessageListProps) { - const { - jumpToLatestMessage, - loadMore, - loadMoreNewer, - } = useChannelActionContext('VirtualizedMessageList'); + const { jumpToLatestMessage, loadMore, loadMoreNewer } = + useChannelActionContext('VirtualizedMessageList'); const { channel, channelUnreadUiState, diff --git a/src/components/MessageList/VirtualizedMessageListComponents.tsx b/src/components/MessageList/VirtualizedMessageListComponents.tsx index f77b5b012b..dafb400b99 100644 --- a/src/components/MessageList/VirtualizedMessageListComponents.tsx +++ b/src/components/MessageList/VirtualizedMessageListComponents.tsx @@ -25,7 +25,7 @@ export function calculateFirstItemIndex(numItemsPrepended: number) { } export const makeItemsRenderedHandler = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( renderedItemsActions: Array<(msg: StreamMessage[]) => void>, processedMessages: StreamMessage[], @@ -43,14 +43,14 @@ export const makeItemsRenderedHandler = < }, 200); type CommonVirtuosoComponentProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { context?: VirtuosoContext; }; // using 'display: inline-block' // traps CSS margins of the item elements, preventing incorrect item measurements export const Item = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ context, ...props @@ -76,7 +76,7 @@ export const Item = < ); }; export const Header = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ context, }: CommonVirtuosoComponentProps) => { @@ -96,13 +96,12 @@ export const Header = < ); }; export const EmptyPlaceholder = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ context, }: CommonVirtuosoComponentProps) => { - const { - EmptyStateIndicator = DefaultEmptyStateIndicator, - } = useComponentContext('VirtualizedMessageList'); + const { EmptyStateIndicator = DefaultEmptyStateIndicator } = + useComponentContext('VirtualizedMessageList'); return ( <> {EmptyStateIndicator && ( @@ -113,7 +112,7 @@ export const EmptyPlaceholder = < }; export const messageRenderer = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( virtuosoIndex: number, _data: UnknownType, diff --git a/src/components/MessageList/__tests__/CustomNotification.test.js b/src/components/MessageList/__tests__/CustomNotification.test.js index adda5ddc41..649683df29 100644 --- a/src/components/MessageList/__tests__/CustomNotification.test.js +++ b/src/components/MessageList/__tests__/CustomNotification.test.js @@ -1,4 +1,3 @@ - import React from 'react'; import renderer from 'react-test-renderer'; import { cleanup, render } from '@testing-library/react'; @@ -6,7 +5,7 @@ import { cleanup, render } from '@testing-library/react'; import { CustomNotification } from '../CustomNotification'; -afterEach(cleanup); +afterEach(cleanup); describe('CustomNotification', () => { it('should render nothing if active is false', () => { diff --git a/src/components/MessageList/__tests__/MessageList.test.js b/src/components/MessageList/__tests__/MessageList.test.js index 3b3f3094a2..e1e18ee92f 100644 --- a/src/components/MessageList/__tests__/MessageList.test.js +++ b/src/components/MessageList/__tests__/MessageList.test.js @@ -364,7 +364,7 @@ describe('MessageList', () => { return null; } } - + window.IntersectionObserver = IntersectionObserverMock; }); afterEach(jest.clearAllMocks); diff --git a/src/components/MessageList/__tests__/MessageNotification.test.js b/src/components/MessageList/__tests__/MessageNotification.test.js index dd8d021937..067aa735f2 100644 --- a/src/components/MessageList/__tests__/MessageNotification.test.js +++ b/src/components/MessageList/__tests__/MessageNotification.test.js @@ -7,7 +7,7 @@ expect.extend(toHaveNoViolations); import { MessageNotification } from '../MessageNotification'; -afterEach(cleanup); +afterEach(cleanup); describe('MessageNotification', () => { it('should render nothing if showNotification is false', () => { diff --git a/src/components/MessageList/__tests__/ScrollToBottomButton.test.js b/src/components/MessageList/__tests__/ScrollToBottomButton.test.js index 83236055cf..fe581f0c61 100644 --- a/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +++ b/src/components/MessageList/__tests__/ScrollToBottomButton.test.js @@ -94,7 +94,6 @@ describe.each([ }); await waitFor(() => { - expect(onClick).toHaveBeenCalled(); }); }); diff --git a/src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts b/src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts index f85af4c104..7a344c7bc7 100644 --- a/src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts +++ b/src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts @@ -18,7 +18,7 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export const useEnrichedMessages = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(args: { channel: Channel; disableDateSeparator: boolean; diff --git a/src/components/MessageList/hooks/MessageList/useMessageListElements.tsx b/src/components/MessageList/hooks/MessageList/useMessageListElements.tsx index c7c77be12f..6b9c84a20d 100644 --- a/src/components/MessageList/hooks/MessageList/useMessageListElements.tsx +++ b/src/components/MessageList/hooks/MessageList/useMessageListElements.tsx @@ -13,7 +13,7 @@ import type { ChannelUnreadUiState, DefaultStreamChatGenerics } from '../../../. import { MessageRenderer, SharedMessageProps } from '../../renderMessages'; type UseMessageListElementsProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { enrichedMessages: StreamMessage[]; internalMessageProps: SharedMessageProps; @@ -26,7 +26,7 @@ type UseMessageListElementsProps< }; export const useMessageListElements = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: UseMessageListElementsProps, ) => { @@ -52,9 +52,10 @@ export const useMessageListElements = < userID: client.userID, }); - const lastReceivedMessageId = useMemo(() => getLastReceived(enrichedMessages), [ - enrichedMessages, - ]); + const lastReceivedMessageId = useMemo( + () => getLastReceived(enrichedMessages), + [enrichedMessages], + ); const elements: React.ReactNode[] = useMemo( () => diff --git a/src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts b/src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts index c4c7d74edb..73cf082a89 100644 --- a/src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts +++ b/src/components/MessageList/hooks/MessageList/useMessageListScrollManager.ts @@ -12,7 +12,7 @@ export type ContainerMeasures = { }; export type UseMessageListScrollManagerParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { loadMoreScrollThreshold: number; messages: StreamMessage[]; @@ -25,7 +25,7 @@ export type UseMessageListScrollManagerParams< // FIXME: change this generic name to something like useAdjustScrollPositionToListSize export function useMessageListScrollManager< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(params: UseMessageListScrollManagerParams) { const { loadMoreScrollThreshold, diff --git a/src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx b/src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx index ab4b18a402..898b91a77d 100644 --- a/src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx +++ b/src/components/MessageList/hooks/MessageList/useScrollLocationLogic.tsx @@ -7,7 +7,7 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export type UseScrollLocationLogicParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { hasMoreNewer: boolean; listElement: HTMLDivElement | null; @@ -18,7 +18,7 @@ export type UseScrollLocationLogicParams< }; export const useScrollLocationLogic = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: UseScrollLocationLogicParams, ) => { diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts index 6e67f1890b..8566e800da 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.ts @@ -9,13 +9,12 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export const useGiphyPreview = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( separateGiphyPreview: boolean, ) => { - const [giphyPreviewMessage, setGiphyPreviewMessage] = useState< - StreamMessage - >(); + const [giphyPreviewMessage, setGiphyPreviewMessage] = + useState>(); const { client } = useChatContext('useGiphyPreview'); diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts index 584ba1a187..8aa0068354 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.ts @@ -3,13 +3,13 @@ import { StreamMessage } from '../../../../context'; import { DefaultStreamChatGenerics } from '../../../../types/types'; type UseMessageSetKeyParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { messages?: StreamMessage[]; }; export const useMessageSetKey = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ messages, }: UseMessageSetKeyParams) => { diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts index ad4fda0f3e..8441ac9d1e 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.ts @@ -5,7 +5,7 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export function useNewMessageNotification< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( messages: StreamMessage[], currentUserId: string | undefined, diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts b/src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts index f2bff5eed2..3cea713476 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.ts @@ -4,13 +4,13 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; -const STATUSES_EXCLUDED_FROM_PREPEND = ({ +const STATUSES_EXCLUDED_FROM_PREPEND = { failed: true, sending: true, -} as const) as Record; +} as const as Record; export function usePrependedMessagesCount< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(messages: StreamMessage[], hasDateSeparator: boolean) { const firstRealMessageIndex = hasDateSeparator ? 1 : 0; const firstMessageOnFirstLoadedPage = useRef>(); diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts index 712040a2e3..fa20a250ea 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.ts @@ -3,7 +3,7 @@ import { StreamMessage } from '../../../../context'; import { DefaultStreamChatGenerics } from '../../../../types/types'; type UseScrollToBottomOnNewMessageParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { scrollToBottom: () => void; messages?: StreamMessage[]; @@ -12,7 +12,7 @@ type UseScrollToBottomOnNewMessageParams< }; export const useScrollToBottomOnNewMessage = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ messages, scrollToBottom, diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts index 11103b60f9..fb18dd24ae 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.ts @@ -5,7 +5,7 @@ import type { StreamMessage } from '../../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../../types/types'; export function useShouldForceScrollToBottom< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(messages: StreamMessage[], currentUserId?: string) { const lastFocusedOwnMessage = useRef(''); const initialFocusRegistered = useRef(false); diff --git a/src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts b/src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts index f86f9395e6..c5c280bd39 100644 --- a/src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts +++ b/src/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.ts @@ -21,7 +21,7 @@ export type UseUnreadMessagesNotificationParams = { * @param unreadCount */ export const useUnreadMessagesNotificationVirtualized = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ lastRead, showAlways, diff --git a/src/components/MessageList/hooks/useLastReadData.ts b/src/components/MessageList/hooks/useLastReadData.ts index 814cd4596c..f631f53a90 100644 --- a/src/components/MessageList/hooks/useLastReadData.ts +++ b/src/components/MessageList/hooks/useLastReadData.ts @@ -9,7 +9,7 @@ import type { StreamMessage } from '../../../context/ChannelStateContext'; import type { DefaultStreamChatGenerics } from '../../../types/types'; type UseLastReadDataParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { messages: StreamMessage[]; returnAllReadData: boolean; @@ -18,7 +18,7 @@ type UseLastReadDataParams< }; export const useLastReadData = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: UseLastReadDataParams, ) => { diff --git a/src/components/MessageList/hooks/useMarkRead.ts b/src/components/MessageList/hooks/useMarkRead.ts index 311f64fc3e..730e943112 100644 --- a/src/components/MessageList/hooks/useMarkRead.ts +++ b/src/components/MessageList/hooks/useMarkRead.ts @@ -26,7 +26,7 @@ type UseMarkReadParams = { * @param wasChannelMarkedUnread */ export const useMarkRead = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ isMessageListScrolledToBottom, messageListIsThread, @@ -108,7 +108,7 @@ export const useMarkRead = < }; function getPreviousLastMessage< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(messages: StreamMessage[], newMessage?: MessageResponse) { if (!newMessage) return; let previousLastMessage; diff --git a/src/components/MessageList/renderMessages.tsx b/src/components/MessageList/renderMessages.tsx index d44a050b57..7c6667220f 100644 --- a/src/components/MessageList/renderMessages.tsx +++ b/src/components/MessageList/renderMessages.tsx @@ -15,7 +15,7 @@ import type { StreamMessage } from '../../context/ChannelStateContext'; import type { MessageProps } from '../Message'; export interface RenderMessagesOptions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > { components: ComponentContextValue; lastReceivedMessageId: string | null; @@ -39,11 +39,11 @@ export interface RenderMessagesOptions< } export type SharedMessageProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, MessagePropsToOmit>; export type MessageRenderer< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (options: RenderMessagesOptions) => Array; type MessagePropsToOmit = @@ -55,7 +55,7 @@ type MessagePropsToOmit = | 'readBy'; export function defaultRenderMessages< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ channelUnreadUiState, components, diff --git a/src/components/MessageList/utils.ts b/src/components/MessageList/utils.ts index 5379246430..78dd090cf3 100644 --- a/src/components/MessageList/utils.ts +++ b/src/components/MessageList/utils.ts @@ -1,4 +1,3 @@ - import { nanoid } from 'nanoid'; import { CUSTOM_MESSAGE_TYPE } from '../../constants/messageTypes'; @@ -23,7 +22,7 @@ type ProcessMessagesContext = { }; export type ProcessMessagesParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ProcessMessagesContext & { messages: StreamMessage[]; reviewProcessedMessage?: (params: { @@ -61,18 +60,13 @@ export type ProcessMessagesParams< * @return {StreamMessage[]} Transformed list of messages */ export const processMessages = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: ProcessMessagesParams, ) => { const { messages, reviewProcessedMessage, setGiphyPreviewMessage, ...context } = params; - const { - enableDateSeparator, - hideDeletedMessages, - hideNewMessageSeparator, - lastRead, - userId, - } = context; + const { enableDateSeparator, hideDeletedMessages, hideNewMessageSeparator, lastRead, userId } = + context; let unread = false; let ephemeralMessagePresent = false; @@ -171,7 +165,7 @@ export const makeDateMessageId = (date?: string | Date) => { // fast since it usually iterates just the last few messages export const getLastReceived = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( messages: StreamMessage[], ) => { @@ -185,7 +179,7 @@ export const getLastReceived = < }; export const getReadStates = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( messages: StreamMessage[], read: Record }> = {}, @@ -229,15 +223,15 @@ export const getReadStates = < }; export const insertIntro = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( messages: StreamMessage[], headerPosition?: number, ) => { const newMessages = messages; - const intro = ({ + const intro = { customType: CUSTOM_MESSAGE_TYPE.intro, - } as unknown) as StreamMessage; + } as unknown as StreamMessage; // if no headerPosition is set, HeaderComponent will go at the top if (!headerPosition) { @@ -285,7 +279,7 @@ export const insertIntro = < export type GroupStyle = '' | 'middle' | 'top' | 'bottom' | 'single'; export const getGroupStyles = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( message: StreamMessage, previousMessage: StreamMessage, @@ -368,7 +362,7 @@ type DateSeparatorMessage = { }; export function isDateSeparatorMessage< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(message: StreamMessage): message is DateSeparatorMessage { return message.customType === CUSTOM_MESSAGE_TYPE.date && !!message.date && isDate(message.date); } diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index f1e21c7ec4..6faff0f269 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -34,7 +34,7 @@ export const Modal = ({ children, className, onClose, open }: PropsWithChildren< if (!open) return; const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Escape') onClose?.((event as unknown) as React.KeyboardEvent); + if (event.key === 'Escape') onClose?.(event as unknown as React.KeyboardEvent); }; document.addEventListener('keydown', handleKeyDown); diff --git a/src/components/Modal/__tests__/Modal.test.js b/src/components/Modal/__tests__/Modal.test.js index a462454ffd..5b177cd168 100644 --- a/src/components/Modal/__tests__/Modal.test.js +++ b/src/components/Modal/__tests__/Modal.test.js @@ -6,7 +6,7 @@ import '@testing-library/jest-dom'; import { Modal } from '../Modal'; describe('Modal', () => { - afterEach(cleanup); + afterEach(cleanup); it('should be closed (null) if the `open` prop is set to false', () => { const { container } = render( {}} open={false} />); diff --git a/src/components/Poll/Poll.tsx b/src/components/Poll/Poll.tsx index 55dcbb058a..016864244a 100644 --- a/src/components/Poll/Poll.tsx +++ b/src/components/Poll/Poll.tsx @@ -6,7 +6,7 @@ import type { Poll as PollClass } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types'; export const Poll = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ isQuoted, poll, @@ -14,10 +14,8 @@ export const Poll = < poll: PollClass; isQuoted?: boolean; }) => { - const { - PollContent = DefaultPollContent, - QuotedPoll = DefaultQuotedPoll, - } = useComponentContext(); + const { PollContent = DefaultPollContent, QuotedPoll = DefaultQuotedPoll } = + useComponentContext(); return poll ? ( {isQuoted ? : } ) : null; diff --git a/src/components/Poll/PollActions/AddCommentForm.tsx b/src/components/Poll/PollActions/AddCommentForm.tsx index 71530f52ab..ff3b0d51ac 100644 --- a/src/components/Poll/PollActions/AddCommentForm.tsx +++ b/src/components/Poll/PollActions/AddCommentForm.tsx @@ -7,7 +7,7 @@ import type { DefaultStreamChatGenerics } from '../../../types'; type PollStateSelectorReturnValue = { ownAnswer: PollAnswer | undefined }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ ownAnswer: nextValue.ownAnswer }); @@ -18,7 +18,7 @@ export type AddCommentFormProps = { }; export const AddCommentForm = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, messageId, diff --git a/src/components/Poll/PollActions/EndPollDialog.tsx b/src/components/Poll/PollActions/EndPollDialog.tsx index a1b851e76b..103243bdae 100644 --- a/src/components/Poll/PollActions/EndPollDialog.tsx +++ b/src/components/Poll/PollActions/EndPollDialog.tsx @@ -8,7 +8,7 @@ export type EndPollDialogProps = { }; export const EndPollDialog = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, }: EndPollDialogProps) => { diff --git a/src/components/Poll/PollActions/PollActions.tsx b/src/components/Poll/PollActions/PollActions.tsx index 99fac20dae..1cc1842327 100644 --- a/src/components/Poll/PollActions/PollActions.tsx +++ b/src/components/Poll/PollActions/PollActions.tsx @@ -43,7 +43,7 @@ type PollStateSelectorReturnValue = { ownAnswer: PollAnswer | undefined; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -66,7 +66,7 @@ export type PollActionsProps = { }; export const PollActions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ AddCommentForm = DefaultAddCommentForm, EndPollDialog = DefaultEndPollDialog, diff --git a/src/components/Poll/PollActions/PollAnswerList.tsx b/src/components/Poll/PollActions/PollAnswerList.tsx index 78a6e59b8c..c651d2e1f2 100644 --- a/src/components/Poll/PollActions/PollAnswerList.tsx +++ b/src/components/Poll/PollActions/PollAnswerList.tsx @@ -15,7 +15,7 @@ type PollStateSelectorReturnValue = { ownAnswer: PollAnswer | undefined; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -29,7 +29,7 @@ export type PollAnswerListProps = { }; export const PollAnswerList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, onUpdateOwnAnswerClick, @@ -38,13 +38,8 @@ export const PollAnswerList = < const { poll } = usePollContext(); const { is_closed, ownAnswer } = useStateStore(poll.state, pollStateSelector); - const { - answers, - error, - hasNextPage, - loading, - loadMore, - } = usePollAnswerPagination(); + const { answers, error, hasNextPage, loading, loadMore } = + usePollAnswerPagination(); return (
diff --git a/src/components/Poll/PollActions/PollOptionsFullList.tsx b/src/components/Poll/PollActions/PollOptionsFullList.tsx index 505b562074..0fae91f8fb 100644 --- a/src/components/Poll/PollActions/PollOptionsFullList.tsx +++ b/src/components/Poll/PollActions/PollOptionsFullList.tsx @@ -9,7 +9,7 @@ import type { DefaultStreamChatGenerics } from '../../../types'; type PollStateSelectorReturnValue = { name: string }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ name: nextValue.name }); @@ -19,7 +19,7 @@ export type FullPollOptionsListingProps = { }; export const PollOptionsFullList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, }: FullPollOptionsListingProps) => { diff --git a/src/components/Poll/PollActions/PollResults/PollOptionVotesList.tsx b/src/components/Poll/PollActions/PollResults/PollOptionVotesList.tsx index ffdeb740c7..da98bbe6b5 100644 --- a/src/components/Poll/PollActions/PollResults/PollOptionVotesList.tsx +++ b/src/components/Poll/PollActions/PollResults/PollOptionVotesList.tsx @@ -8,13 +8,13 @@ import type { PollOption, PollOptionVotesQueryParams } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../../types'; export type PollOptionVotesListingProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { option: PollOption; }; export const PollOptionVotesList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ option, }: PollOptionVotesListingProps) => { @@ -22,15 +22,10 @@ export const PollOptionVotesList = < () => ({ filter: { option_id: option.id } }), [option.id], ); - const { - error, - hasNextPage, - loading, - loadMore, - votes, - } = usePollOptionVotesPagination({ - paginationParams, - }); + const { error, hasNextPage, loading, loadMore, votes } = + usePollOptionVotesPagination({ + paginationParams, + }); return (
diff --git a/src/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.tsx b/src/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.tsx index 2eb867b8aa..8b14459dc0 100644 --- a/src/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.tsx +++ b/src/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.tsx @@ -7,17 +7,17 @@ import type { PollOption, PollState, PollVote } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../../types'; type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { latest_votes_by_option: Record[]> }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ latest_votes_by_option: nextValue.latest_votes_by_option }); export type PollOptionWithVotesProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { option: PollOption; countVotesPreview?: number; @@ -25,7 +25,7 @@ export type PollOptionWithVotesProps< }; export const PollOptionWithLatestVotes = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ countVotesPreview = 5, option, diff --git a/src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx b/src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx index 55febf9588..8e5edb0f84 100644 --- a/src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx +++ b/src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx @@ -9,7 +9,7 @@ type PollStateSelectorReturnValue = { vote_counts_by_option: Record; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -22,7 +22,7 @@ export type PollResultOptionVoteCounterProps = { }; export const PollResultOptionVoteCounter = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ optionId, }: PollResultOptionVoteCounterProps) => { @@ -43,13 +43,13 @@ export const PollResultOptionVoteCounter = < }; export type PollOptionWithVotesHeaderProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { option: PollOption; }; export const PollOptionWithVotesHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ option, }: PollOptionWithVotesHeaderProps) => ( diff --git a/src/components/Poll/PollActions/PollResults/PollResults.tsx b/src/components/Poll/PollActions/PollResults/PollResults.tsx index c76b998711..3f2d64a3c8 100644 --- a/src/components/Poll/PollActions/PollResults/PollResults.tsx +++ b/src/components/Poll/PollActions/PollResults/PollResults.tsx @@ -9,14 +9,14 @@ import type { PollOption, PollState } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../../types'; type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { name: string; options: PollOption[]; vote_counts_by_option: Record; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -30,7 +30,7 @@ export type PollResultsProps = { }; export const PollResults = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, }: PollResultsProps) => { diff --git a/src/components/Poll/PollActions/SuggestPollOptionForm.tsx b/src/components/Poll/PollActions/SuggestPollOptionForm.tsx index 3629450fff..f7baf8fcc9 100644 --- a/src/components/Poll/PollActions/SuggestPollOptionForm.tsx +++ b/src/components/Poll/PollActions/SuggestPollOptionForm.tsx @@ -6,10 +6,10 @@ import type { PollOption, PollState } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types'; type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { options: PollOption[] }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ options: nextValue.options }); @@ -20,7 +20,7 @@ export type SuggestPollOptionFormProps = { }; export const SuggestPollOptionForm = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ close, messageId, diff --git a/src/components/Poll/PollContent.tsx b/src/components/Poll/PollContent.tsx index 96100a2fa0..0346c7e046 100644 --- a/src/components/Poll/PollContent.tsx +++ b/src/components/Poll/PollContent.tsx @@ -11,17 +11,15 @@ import type { DefaultStreamChatGenerics } from '../../types'; type PollStateSelectorPollContentReturnValue = { is_closed: boolean | undefined }; const pollStateSelectorPollContent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorPollContentReturnValue => ({ is_closed: nextValue.is_closed }); export const PollContent = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { - const { - PollHeader = DefaultPollHeader, - PollActions = DefaultPollActions, - } = useComponentContext(); + const { PollHeader = DefaultPollHeader, PollActions = DefaultPollActions } = + useComponentContext(); const { poll } = usePollContext(); const { is_closed } = useStateStore(poll.state, pollStateSelectorPollContent); diff --git a/src/components/Poll/PollCreationDialog/OptionFieldSet.tsx b/src/components/Poll/PollCreationDialog/OptionFieldSet.tsx index 0246c564c0..8bc726569f 100644 --- a/src/components/Poll/PollCreationDialog/OptionFieldSet.tsx +++ b/src/components/Poll/PollCreationDialog/OptionFieldSet.tsx @@ -7,7 +7,7 @@ import { DragAndDropContainer } from '../../DragAndDrop/DragAndDropContainer'; import { useTranslationContext } from '../../../context'; import type { OptionErrors, PollFormState, PollOptionFormData } from './types'; -const VALIDATION_ERRORS = ({ 'Option already exists': true } as const) as Record; +const VALIDATION_ERRORS = { 'Option already exists': true } as const as Record; export type OptionFieldSetProps = { errors: OptionErrors; diff --git a/src/components/Poll/PollCreationDialog/PollCreationDialog.tsx b/src/components/Poll/PollCreationDialog/PollCreationDialog.tsx index 3750b2befc..0d222db803 100644 --- a/src/components/Poll/PollCreationDialog/PollCreationDialog.tsx +++ b/src/components/Poll/PollCreationDialog/PollCreationDialog.tsx @@ -36,7 +36,7 @@ export const PollCreationDialog = ({ close }: PollCreationDialogProps) => { options: [{ id: nanoid(), text: '' }], user_id: client.user?.id, voting_visibility: 'public', - } as PollFormState), + }) as PollFormState, ); return ( diff --git a/src/components/Poll/PollHeader.tsx b/src/components/Poll/PollHeader.tsx index 673da17679..939cb23f3d 100644 --- a/src/components/Poll/PollHeader.tsx +++ b/src/components/Poll/PollHeader.tsx @@ -5,7 +5,7 @@ import type { PollOption, PollState } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types'; type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { enforce_unique_vote: boolean; is_closed: boolean | undefined; @@ -14,7 +14,7 @@ type PollStateSelectorReturnValue< options: PollOption[]; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -26,7 +26,7 @@ const pollStateSelector = < }); export const PollHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { t } = useTranslationContext('PollHeader'); diff --git a/src/components/Poll/PollOptionList.tsx b/src/components/Poll/PollOptionList.tsx index 16c816420b..3de14f5490 100644 --- a/src/components/Poll/PollOptionList.tsx +++ b/src/components/Poll/PollOptionList.tsx @@ -7,11 +7,11 @@ import type { PollOption, PollState } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../types'; type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { options: PollOption[] }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ options: nextValue.options }); @@ -21,13 +21,12 @@ export type PollOptionListProps = { }; export const PollOptionList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ optionsDisplayCount, }: PollOptionListProps) => { - const { - PollOptionSelector = DefaultPollOptionSelector, - } = useComponentContext(); + const { PollOptionSelector = DefaultPollOptionSelector } = + useComponentContext(); const { poll } = usePollContext(); const { options } = useStateStore(poll.state, pollStateSelector); diff --git a/src/components/Poll/PollOptionSelector.tsx b/src/components/Poll/PollOptionSelector.tsx index 4b253ab9bb..3f228cb0d0 100644 --- a/src/components/Poll/PollOptionSelector.tsx +++ b/src/components/Poll/PollOptionSelector.tsx @@ -38,7 +38,7 @@ export const Checkmark = ({ checked }: CheckmarkProps) => ( ); type PollStateSelectorReturnValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { is_closed: boolean | undefined; latest_votes_by_option: Record[]>; @@ -48,7 +48,7 @@ type PollStateSelectorReturnValue< voting_visibility: VotingVisibility | undefined; }; const pollStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorReturnValue => ({ @@ -61,7 +61,7 @@ const pollStateSelector = < }); export type PollOptionSelectorProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { option: PollOption; displayAvatarCount?: number; @@ -69,16 +69,15 @@ export type PollOptionSelectorProps< }; export const PollOptionSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ displayAvatarCount, option, voteCountVerbose, }: PollOptionSelectorProps) => { const { t } = useTranslationContext(); - const { channelCapabilities = {} } = useChannelStateContext( - 'PollOptionsShortlist', - ); + const { channelCapabilities = {} } = + useChannelStateContext('PollOptionsShortlist'); const { message } = useMessageContext(); const { poll } = usePollContext(); @@ -134,7 +133,7 @@ export const PollOptionSelector = <
{voteCountVerbose ? t('{{count}} votes', { count: vote_counts_by_option[option.id] ?? 0 }) - : vote_counts_by_option[option.id] ?? 0} + : (vote_counts_by_option[option.id] ?? 0)}
{ }; type PollVoteProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { vote: PollVoteType; }; const PollVoteAuthor = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ vote, }: PollVoteProps) => { @@ -81,7 +81,7 @@ const PollVoteAuthor = < }; export const PollVote = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ vote, }: PollVoteProps) => ( @@ -92,13 +92,13 @@ export const PollVote = < ); export type PollVoteListingProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { votes: PollVoteType[]; }; export const PollVoteListing = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ votes, }: PollVoteListingProps) => ( diff --git a/src/components/Poll/QuotedPoll.tsx b/src/components/Poll/QuotedPoll.tsx index e995c6fa01..b77d05e45c 100644 --- a/src/components/Poll/QuotedPoll.tsx +++ b/src/components/Poll/QuotedPoll.tsx @@ -7,7 +7,7 @@ import type { DefaultStreamChatGenerics } from '../../types'; type PollStateSelectorQuotedPollReturnValue = { is_closed: boolean | undefined; name: string }; const pollStateSelectorQuotedPoll = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( nextValue: PollState, ): PollStateSelectorQuotedPollReturnValue => ({ @@ -16,7 +16,7 @@ const pollStateSelectorQuotedPoll = < }); export const QuotedPoll = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const { poll } = usePollContext(); const { is_closed, name } = useStateStore(poll.state, pollStateSelectorQuotedPoll); diff --git a/src/components/Poll/__tests__/PollCreationDialog.test.js b/src/components/Poll/__tests__/PollCreationDialog.test.js index 7be590b39d..d75c404321 100644 --- a/src/components/Poll/__tests__/PollCreationDialog.test.js +++ b/src/components/Poll/__tests__/PollCreationDialog.test.js @@ -166,7 +166,7 @@ describe('PollCreationDialog', () => { await fireEvent.blur(optionFields[1]); }); const optionErrors = screen.getAllByTestId(OPTION_INPUT_FIELD_ERROR_TEST_ID); - + expect(optionErrors).toHaveLength(3); expect(optionErrors[1]).toHaveTextContent(DUPLICATE_OPTION_FIELD_ERROR_TEXT); expect(screen.getByText(CANCEL_BUTTON_TEXT)).toBeEnabled(); @@ -196,7 +196,7 @@ describe('PollCreationDialog', () => { expect(optionFields[1]).toHaveValue(text); expect(optionFields[2]).toHaveValue(''); const optionErrors = screen.getAllByTestId(OPTION_INPUT_FIELD_ERROR_TEST_ID); - + expect(optionErrors).toHaveLength(3); expect(optionErrors[0]).not.toHaveTextContent(); expect(optionErrors[1]).not.toHaveTextContent(); @@ -221,7 +221,7 @@ describe('PollCreationDialog', () => { await fireEvent.change(optionFields[0], { target: { value: '' } }); }); optionFields = screen.getAllByPlaceholderText(OPTION_FIELD_PLACEHOLDER); - + expect(optionFields).toHaveLength(1); expect(screen.getByText(CANCEL_BUTTON_TEXT)).toBeEnabled(); expect(screen.getByText(CREATE_BUTTON_TEXT)).toBeDisabled(); @@ -284,7 +284,7 @@ describe('PollCreationDialog', () => { }); const maxVoteCountErrors = screen.getAllByTestId(MAX_VOTE_COUT_INPUT_FIELD_ERROR_TEST_ID); - + expect(maxVoteCountErrors).toHaveLength(1); expect(maxVoteCountErrors[0]).toHaveTextContent(MAX_VOTE_COUNT_FIELD_ERROR_TEXT); expect(screen.getByPlaceholderText(MAX_VOTES_FIELD_PLACEHOLDER).value).toBe('1'); diff --git a/src/components/Poll/hooks/useManagePollVotesRealtime.ts b/src/components/Poll/hooks/useManagePollVotesRealtime.ts index 8682a11745..f2b102f6c8 100644 --- a/src/components/Poll/hooks/useManagePollVotesRealtime.ts +++ b/src/components/Poll/hooks/useManagePollVotesRealtime.ts @@ -9,7 +9,7 @@ export function useManagePollVotesRealtime< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, T extends | PollVote - | PollAnswer = PollVote + | PollAnswer = PollVote, >( managedVoteType: 'answer' | 'vote', cursorPaginatorState?: CursorPaginatorStateStore, diff --git a/src/components/Poll/hooks/usePollAnswerPagination.ts b/src/components/Poll/hooks/usePollAnswerPagination.ts index 5c7a8b8767..059382433e 100644 --- a/src/components/Poll/hooks/usePollAnswerPagination.ts +++ b/src/components/Poll/hooks/usePollAnswerPagination.ts @@ -12,7 +12,7 @@ import type { PollAnswer, PollAnswersQueryParams, PollVote } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../../../types'; const paginationStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( state: CursorPaginatorState>, ): [Error | undefined, boolean, boolean] => [state.error, state.hasNextPage, state.loading]; @@ -22,7 +22,7 @@ type UsePollAnswerPaginationParams = { }; export const usePollAnswerPagination = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ paginationParams }: UsePollAnswerPaginationParams = {}) => { const { poll } = usePollContext(); diff --git a/src/components/Poll/hooks/usePollOptionVotesPagination.ts b/src/components/Poll/hooks/usePollOptionVotesPagination.ts index bde1627d0d..d94b2f479b 100644 --- a/src/components/Poll/hooks/usePollOptionVotesPagination.ts +++ b/src/components/Poll/hooks/usePollOptionVotesPagination.ts @@ -12,7 +12,7 @@ import type { DefaultStreamChatGenerics } from '../../../types'; import type { PollOptionVotesQueryParams, PollVote } from 'stream-chat'; const paginationStateSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( state: CursorPaginatorState>, ): [Error | undefined, boolean, boolean] => [state.error, state.hasNextPage, state.loading]; @@ -22,7 +22,7 @@ type UsePollOptionVotesPaginationParams = { }; export const usePollOptionVotesPagination = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ paginationParams, }: UsePollOptionVotesPaginationParams) => { diff --git a/src/components/ReactFileUtilities/FileIcon/mimeTypes.ts b/src/components/ReactFileUtilities/FileIcon/mimeTypes.ts index 765636fb3f..2a9623ee5b 100644 --- a/src/components/ReactFileUtilities/FileIcon/mimeTypes.ts +++ b/src/components/ReactFileUtilities/FileIcon/mimeTypes.ts @@ -1,11 +1,11 @@ export type GeneralType = 'audio/' | 'video/' | 'image/' | 'text/'; export type SupportedMimeType = - | typeof wordMimeTypes[number] - | typeof excelMimeTypes[number] - | typeof powerpointMimeTypes[number] - | typeof archiveFileTypes[number] - | typeof codeFileTypes[number]; + | (typeof wordMimeTypes)[number] + | (typeof excelMimeTypes)[number] + | (typeof powerpointMimeTypes)[number] + | (typeof archiveFileTypes)[number] + | (typeof codeFileTypes)[number]; export const wordMimeTypes = [ // Microsoft Word diff --git a/src/components/ReactFileUtilities/UploadButton.tsx b/src/components/ReactFileUtilities/UploadButton.tsx index 31821699b2..a06e06f901 100644 --- a/src/components/ReactFileUtilities/UploadButton.tsx +++ b/src/components/ReactFileUtilities/UploadButton.tsx @@ -37,7 +37,7 @@ export type FileInputProps = UploadButtonProps; export const FileInput = UploadButton; export const UploadFileInput = forwardRef(function UploadFileInput< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( { className, @@ -47,14 +47,10 @@ export const UploadFileInput = forwardRef(function UploadFileInput< ref: React.ForwardedRef, ) { const { t } = useTranslationContext('UploadFileInput'); - const { acceptedFiles = [], multipleUploads } = useChannelStateContext( - 'UploadFileInput', - ); - const { - isUploadEnabled, - maxFilesLeft, - uploadNewFiles, - } = useMessageInputContext('UploadFileInput'); + const { acceptedFiles = [], multipleUploads } = + useChannelStateContext('UploadFileInput'); + const { isUploadEnabled, maxFilesLeft, uploadNewFiles } = + useMessageInputContext('UploadFileInput'); const id = useMemo(() => nanoid(), []); const onFileChange = useCallback( diff --git a/src/components/Reactions/ReactionSelector.tsx b/src/components/Reactions/ReactionSelector.tsx index ceeea4c4b0..c618306b57 100644 --- a/src/components/Reactions/ReactionSelector.tsx +++ b/src/components/Reactions/ReactionSelector.tsx @@ -15,7 +15,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types'; import type { ReactionOptions } from './reactionOptions'; export type ReactionSelectorProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Custom UI component to display user avatar, defaults to and accepts same props as: [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) */ Avatar?: React.ElementType; @@ -44,7 +44,7 @@ export type ReactionSelectorProps< }; const UnMemoizedReactionSelector = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ReactionSelectorProps, ) => { @@ -179,9 +179,8 @@ const UnMemoizedReactionSelector = < className={clsx( 'str-chat__message-reactions-list-item str-chat__message-reactions-option', { - 'str-chat__message-reactions-option-selected': iHaveReactedWithReaction( - reactionType, - ), + 'str-chat__message-reactions-option-selected': + iHaveReactedWithReaction(reactionType), }, )} data-testid='select-reaction-button' diff --git a/src/components/Reactions/ReactionSelectorWithButton.tsx b/src/components/Reactions/ReactionSelectorWithButton.tsx index 07ad6b4a6d..e434de8af1 100644 --- a/src/components/Reactions/ReactionSelectorWithButton.tsx +++ b/src/components/Reactions/ReactionSelectorWithButton.tsx @@ -15,7 +15,7 @@ type ReactionSelectorWithButtonProps = { * cluttering the parent component. */ export const ReactionSelectorWithButton = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ ReactionIcon, }: ReactionSelectorWithButtonProps) => { diff --git a/src/components/Reactions/ReactionsList.tsx b/src/components/Reactions/ReactionsList.tsx index c03025e445..239fba19e1 100644 --- a/src/components/Reactions/ReactionsList.tsx +++ b/src/components/Reactions/ReactionsList.tsx @@ -12,7 +12,7 @@ import { MessageContextValue, useTranslationContext } from '../../context'; import { MAX_MESSAGE_REACTIONS_TO_FETCH } from '../Message/hooks'; export type ReactionsListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial< Pick, 'handleFetchReactions' | 'reactionDetailsSort'> > & { @@ -43,7 +43,7 @@ export type ReactionsListProps< }; const UnMemoizedReactionsList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ReactionsListProps, ) => { @@ -55,10 +55,8 @@ const UnMemoizedReactionsList = < ...rest } = props; const { existingReactions, hasReactions, totalReactionCount } = useProcessReactions(rest); - const [ - selectedReactionType, - setSelectedReactionType, - ] = useState | null>(null); + const [selectedReactionType, setSelectedReactionType] = + useState | null>(null); const { t } = useTranslationContext('ReactionsList'); const handleReactionButtonClick = (reactionType: string) => { diff --git a/src/components/Reactions/ReactionsListModal.tsx b/src/components/Reactions/ReactionsListModal.tsx index bdeb91c7e2..20ee26019f 100644 --- a/src/components/Reactions/ReactionsListModal.tsx +++ b/src/components/Reactions/ReactionsListModal.tsx @@ -12,7 +12,7 @@ import { DefaultStreamChatGenerics } from '../../types/types'; import { ReactionSort } from 'stream-chat'; type ReactionsListModalProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ModalProps & Partial< Pick, 'handleFetchReactions' | 'reactionDetailsSort'> @@ -28,7 +28,7 @@ type ReactionsListModalProps< const defaultReactionDetailsSort = { created_at: -1 } as const; export function ReactionsListModal< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ handleFetchReactions, onSelectedReactionTypeChange, @@ -49,15 +49,13 @@ export function ReactionsListModal< const legacySortReactionDetails = propSortReactionDetails ?? contextSortReactionDetails; const reactionDetailsSort = propReactionDetailsSort ?? contextReactionDetailsSort ?? defaultReactionDetailsSort; - const { - isLoading: areReactionsLoading, - reactions: reactionDetails, - } = useFetchReactions({ - handleFetchReactions, - reactionType: selectedReactionType, - shouldFetch: modalProps.open, - sort: reactionDetailsSort, - }); + const { isLoading: areReactionsLoading, reactions: reactionDetails } = + useFetchReactions({ + handleFetchReactions, + reactionType: selectedReactionType, + shouldFetch: modalProps.open, + sort: reactionDetailsSort, + }); const reactionDetailsWithLegacyFallback = useMemo( () => diff --git a/src/components/Reactions/SimpleReactionsList.tsx b/src/components/Reactions/SimpleReactionsList.tsx index c64e1fb345..7dbf6f9d0f 100644 --- a/src/components/Reactions/SimpleReactionsList.tsx +++ b/src/components/Reactions/SimpleReactionsList.tsx @@ -41,7 +41,7 @@ const WithTooltip = ({ }; export type SimpleReactionsListProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Partial> & { /** An array of the own reaction objects to distinguish own reactions visually */ own_reactions?: ReactionResponse[]; @@ -59,15 +59,14 @@ export type SimpleReactionsListProps< }; const UnMemoizedSimpleReactionsList = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: SimpleReactionsListProps, ) => { const { handleReaction: propHandleReaction, ...rest } = props; - const { handleReaction: contextHandleReaction } = useMessageContext( - 'SimpleReactionsList', - ); + const { handleReaction: contextHandleReaction } = + useMessageContext('SimpleReactionsList'); const { existingReactions, hasReactions, totalReactionCount } = useProcessReactions(rest); diff --git a/src/components/Reactions/__tests__/ReactionsList.test.js b/src/components/Reactions/__tests__/ReactionsList.test.js index 7ae059d700..b3e8bd006c 100644 --- a/src/components/Reactions/__tests__/ReactionsList.test.js +++ b/src/components/Reactions/__tests__/ReactionsList.test.js @@ -1,4 +1,3 @@ - import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; diff --git a/src/components/Reactions/hooks/useFetchReactions.ts b/src/components/Reactions/hooks/useFetchReactions.ts index 0070ce91ca..7e28f85671 100644 --- a/src/components/Reactions/hooks/useFetchReactions.ts +++ b/src/components/Reactions/hooks/useFetchReactions.ts @@ -5,7 +5,7 @@ import { DefaultStreamChatGenerics } from '../../../types/types'; import { ReactionType } from '../types'; export interface FetchReactionsOptions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > { reactionType: ReactionType; shouldFetch: boolean; @@ -14,11 +14,10 @@ export interface FetchReactionsOptions< } export function useFetchReactions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(options: FetchReactionsOptions) { - const { - handleFetchReactions: contextHandleFetchReactions, - } = useMessageContext('useFetchReactions'); + const { handleFetchReactions: contextHandleFetchReactions } = + useMessageContext('useFetchReactions'); const [reactions, setReactions] = useState[]>([]); const { handleFetchReactions: propHandleFetchReactions, diff --git a/src/components/Reactions/hooks/useProcessReactions.tsx b/src/components/Reactions/hooks/useProcessReactions.tsx index cded26fb56..9543ea908b 100644 --- a/src/components/Reactions/hooks/useProcessReactions.tsx +++ b/src/components/Reactions/hooks/useProcessReactions.tsx @@ -27,7 +27,7 @@ export const defaultReactionsSort: ReactionsComparator = (a, b) => { }; export const useProcessReactions = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( params: UseProcessReactionsParams, ) => { @@ -38,12 +38,10 @@ export const useProcessReactions = < reactions: propReactions, sortReactions: propSortReactions, } = params; - const { message, sortReactions: contextSortReactions } = useMessageContext( - 'useProcessReactions', - ); - const { - reactionOptions: contextReactionOptions = defaultReactionOptions, - } = useComponentContext('useProcessReactions'); + const { message, sortReactions: contextSortReactions } = + useMessageContext('useProcessReactions'); + const { reactionOptions: contextReactionOptions = defaultReactionOptions } = + useComponentContext('useProcessReactions'); const reactionOptions = propReactionOptions ?? contextReactionOptions; const sortReactions = propSortReactions ?? contextSortReactions ?? defaultReactionsSort; diff --git a/src/components/Reactions/reactionOptions.tsx b/src/components/Reactions/reactionOptions.tsx index c20dc77d44..37b2f02b35 100644 --- a/src/components/Reactions/reactionOptions.tsx +++ b/src/components/Reactions/reactionOptions.tsx @@ -1,5 +1,5 @@ /* eslint-disable sort-keys */ - + import React from 'react'; import { StreamEmoji } from './StreamEmoji'; diff --git a/src/components/Reactions/types.ts b/src/components/Reactions/types.ts index 030bcc259e..9e9d432e3b 100644 --- a/src/components/Reactions/types.ts +++ b/src/components/Reactions/types.ts @@ -16,9 +16,9 @@ export interface ReactionSummary { export type ReactionsComparator = (a: ReactionSummary, b: ReactionSummary) => number; export type ReactionDetailsComparator< - StreamChatGenerics extends ExtendableGenerics = DefaultGenerics + StreamChatGenerics extends ExtendableGenerics = DefaultGenerics, > = (a: ReactionResponse, b: ReactionResponse) => number; export type ReactionType< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = ReactionResponse['type']; diff --git a/src/components/Thread/Thread.tsx b/src/components/Thread/Thread.tsx index f7060e3096..eb1c8abe90 100644 --- a/src/components/Thread/Thread.tsx +++ b/src/components/Thread/Thread.tsx @@ -29,7 +29,7 @@ import type { ThreadState } from 'stream-chat'; export type ThreadProps< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = { /** Additional props for `MessageInput` component: [available props](https://getstream.io/chat/docs/sdk/react/message-input-components/message_input/#props) */ additionalMessageInputProps?: MessageInputProps; @@ -58,7 +58,7 @@ export type ThreadProps< */ export const Thread = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: ThreadProps, ) => { @@ -83,7 +83,7 @@ const selector = (nextValue: ThreadState) => ({ const ThreadInner = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( props: ThreadProps & { key: string }, ) => { @@ -135,7 +135,6 @@ const ThreadInner = < // FIXME: integrators can customize channel query options but cannot customize channel.getReplies() options loadMoreThread(); } - }, [thread, loadMoreThread]); const threadProps: Pick< diff --git a/src/components/Thread/ThreadHead.tsx b/src/components/Thread/ThreadHead.tsx index edb14884a4..2ed96f30a7 100644 --- a/src/components/Thread/ThreadHead.tsx +++ b/src/components/Thread/ThreadHead.tsx @@ -8,13 +8,12 @@ import { useComponentContext } from '../../context'; import type { DefaultStreamChatGenerics } from '../../types/types'; export const ThreadHead = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: MessageProps, ) => { - const { ThreadStart = DefaultThreadStart } = useComponentContext( - 'ThreadHead', - ); + const { ThreadStart = DefaultThreadStart } = + useComponentContext('ThreadHead'); return (
diff --git a/src/components/Thread/ThreadHeader.tsx b/src/components/Thread/ThreadHeader.tsx index 3afa674871..2703305611 100644 --- a/src/components/Thread/ThreadHeader.tsx +++ b/src/components/Thread/ThreadHeader.tsx @@ -12,7 +12,7 @@ import { useTranslationContext } from '../../context/TranslationContext'; import type { DefaultStreamChatGenerics } from '../../types/types'; export type ThreadHeaderProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** Callback for closing the thread */ closeThread: (event?: React.BaseSyntheticEvent) => void; @@ -21,7 +21,7 @@ export type ThreadHeaderProps< }; export const ThreadHeader = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: ThreadHeaderProps & Pick, 'overrideImage' | 'overrideTitle'>, diff --git a/src/components/Threads/icons.tsx b/src/components/Threads/icons.tsx index db34559da7..9c4f82f1ab 100644 --- a/src/components/Threads/icons.tsx +++ b/src/components/Threads/icons.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import { ComponentPropsWithoutRef } from 'react'; diff --git a/src/components/TypingIndicator/TypingIndicator.tsx b/src/components/TypingIndicator/TypingIndicator.tsx index 2b1e81744d..db40e44f4d 100644 --- a/src/components/TypingIndicator/TypingIndicator.tsx +++ b/src/components/TypingIndicator/TypingIndicator.tsx @@ -42,7 +42,7 @@ const useJoinTypingUsers = (names: string[]) => { * TypingIndicator lists users currently typing, it needs to be a child of Channel component */ const UnMemoizedTypingIndicator = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: TypingIndicatorProps, ) => { diff --git a/src/components/UserItem/__tests__/UserItem.test.js b/src/components/UserItem/__tests__/UserItem.test.js index 33abfa52a6..671856f00e 100644 --- a/src/components/UserItem/__tests__/UserItem.test.js +++ b/src/components/UserItem/__tests__/UserItem.test.js @@ -8,7 +8,7 @@ expect.extend(toHaveNoViolations); import { UserItem } from '../UserItem'; -afterEach(cleanup); +afterEach(cleanup); describe('UserItem', () => { it('should render component with default props', () => { diff --git a/src/components/Window/Window.tsx b/src/components/Window/Window.tsx index 9485eb2c8d..a39e54fbf5 100644 --- a/src/components/Window/Window.tsx +++ b/src/components/Window/Window.tsx @@ -6,14 +6,14 @@ import { StreamMessage, useChannelStateContext } from '../../context/ChannelStat import type { DefaultStreamChatGenerics } from '../../types/types'; export type WindowProps< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** optional prop to force addition of class str-chat__main-panel---with-thread-opn to the Window root element */ thread?: StreamMessage; }; const UnMemoizedWindow = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( props: PropsWithChildren>, ) => { diff --git a/src/context/ChannelActionContext.tsx b/src/context/ChannelActionContext.tsx index 36acea39fa..ca9a346f60 100644 --- a/src/context/ChannelActionContext.tsx +++ b/src/context/ChannelActionContext.tsx @@ -34,11 +34,11 @@ export type MarkReadWrapperOptions = { }; export type MessageAttachments< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Array>; export type MessageToSend< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { attachments?: MessageAttachments; error?: ErrorFromResponse; @@ -52,11 +52,11 @@ export type MessageToSend< }; export type RetrySendMessage< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = (message: StreamMessage) => Promise; export type ChannelActionContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { addNotification: (text: string, type: 'success' | 'error') => void; closeThread: (event?: React.BaseSyntheticEvent) => void; @@ -103,20 +103,20 @@ export const ChannelActionContext = React.createContext({ children, value, }: PropsWithChildren<{ value: ChannelActionContextValue; }>) => ( - + {children} ); export const useChannelActionContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( componentName?: string, ) => { @@ -130,7 +130,7 @@ export const useChannelActionContext = < return {} as ChannelActionContextValue; } - return (contextValue as unknown) as ChannelActionContextValue; + return contextValue as unknown as ChannelActionContextValue; }; /** @@ -140,7 +140,7 @@ export const useChannelActionContext = < */ export const withChannelActionContext = < P extends UnknownType, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( Component: React.ComponentType

, ) => { diff --git a/src/context/ChannelListContext.tsx b/src/context/ChannelListContext.tsx index fb8e96f004..dd9adf46da 100644 --- a/src/context/ChannelListContext.tsx +++ b/src/context/ChannelListContext.tsx @@ -11,7 +11,7 @@ import type { Channel } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../types/types'; export type ChannelListContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** * State representing the array of loaded channels. @@ -30,20 +30,20 @@ export const ChannelListContext = createContext({ children, value, }: PropsWithChildren<{ value: ChannelListContextValue; }>) => ( - + {children} ); export const useChannelListContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( componentName?: string, ) => { @@ -57,5 +57,5 @@ export const useChannelListContext = < return {} as ChannelListContextValue; } - return (contextValue as unknown) as ChannelListContextValue; + return contextValue as unknown as ChannelListContextValue; }; diff --git a/src/context/ChannelStateContext.tsx b/src/context/ChannelStateContext.tsx index fb12ffdc03..ad7c697011 100644 --- a/src/context/ChannelStateContext.tsx +++ b/src/context/ChannelStateContext.tsx @@ -25,13 +25,13 @@ export type ChannelNotifications = Array<{ }>; export type StreamMessage< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = | ReturnType['formatMessage']> | MessageResponse; export type ChannelState< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { suppressAutoscroll: boolean; error?: Error | null; @@ -57,7 +57,7 @@ export type ChannelState< }; export type ChannelStateContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = Omit, 'typing'> & { channel: Channel; channelCapabilities: Record; @@ -85,20 +85,20 @@ export const ChannelStateContext = React.createContext({ children, value, }: PropsWithChildren<{ value: ChannelStateContextValue; }>) => ( - + {children} ); export const useChannelStateContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( componentName?: string, ) => { @@ -112,7 +112,7 @@ export const useChannelStateContext = < return {} as ChannelStateContextValue; } - return (contextValue as unknown) as ChannelStateContextValue; + return contextValue as unknown as ChannelStateContextValue; }; /** @@ -122,7 +122,7 @@ export const useChannelStateContext = < */ export const withChannelStateContext = < P extends UnknownType, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( Component: React.ComponentType

, ) => { diff --git a/src/context/ChatContext.tsx b/src/context/ChatContext.tsx index 514942a5d8..2f6963f246 100644 --- a/src/context/ChatContext.tsx +++ b/src/context/ChatContext.tsx @@ -24,7 +24,7 @@ export type CustomClasses = Partial>; type ChannelCID = string; // e.g.: "messaging:general" export type ChatContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** * Indicates, whether a channels query has been triggered within ChannelList by its channels pagination controller. @@ -62,20 +62,20 @@ export type ChatContextValue< export const ChatContext = React.createContext(undefined); export const ChatProvider = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, value, }: PropsWithChildren<{ value: ChatContextValue; }>) => ( - + {children} ); export const useChatContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( componentName?: string, ) => { @@ -89,7 +89,7 @@ export const useChatContext = < return {} as ChatContextValue; } - return (contextValue as unknown) as ChatContextValue; + return contextValue as unknown as ChatContextValue; }; /** @@ -99,7 +99,7 @@ export const useChatContext = < */ export const withChatContext = < P extends UnknownType, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( Component: React.ComponentType

, ) => { diff --git a/src/context/ComponentContext.tsx b/src/context/ComponentContext.tsx index 493e4414dc..f13dc5ed1a 100644 --- a/src/context/ComponentContext.tsx +++ b/src/context/ComponentContext.tsx @@ -59,7 +59,7 @@ import type { StopAIGenerationButtonProps } from '../components/MessageInput/Sto export type ComponentContextValue< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = { /** Custom UI component to display a message attachment, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Attachment.tsx) */ Attachment?: React.ComponentType>; @@ -198,28 +198,28 @@ export const ComponentContext = React.createContext({}); export const ComponentProvider = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >({ children, value, }: PropsWithChildren<{ value: Partial>; }>) => ( - + {children} ); export const useComponentContext = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( /** * @deprecated */ // eslint-disable-next-line @typescript-eslint/no-unused-vars _componentName?: string, -) => (useContext(ComponentContext) as unknown) as ComponentContextValue; +) => useContext(ComponentContext) as unknown as ComponentContextValue; /** * Typescript currently does not support partial inference, so if ComponentContext @@ -229,7 +229,7 @@ export const useComponentContext = < export const withComponentContext = < P extends UnknownType, StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( Component: React.ComponentType

, ) => { diff --git a/src/context/MessageBounceContext.tsx b/src/context/MessageBounceContext.tsx index 7bd50e32ec..e4ac68f622 100644 --- a/src/context/MessageBounceContext.tsx +++ b/src/context/MessageBounceContext.tsx @@ -6,7 +6,7 @@ import { useChannelActionContext } from './ChannelActionContext'; import { isMessageBounced } from '../components'; export interface MessageBounceContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > { handleDelete: ReactEventHandler; handleEdit: ReactEventHandler; @@ -17,7 +17,7 @@ export interface MessageBounceContextValue< const MessageBounceContext = createContext(undefined); export function useMessageBounceContext< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >(componentName?: string) { const contextValue = useContext(MessageBounceContext); @@ -33,7 +33,7 @@ export function useMessageBounceContext< } export function MessageBounceProvider< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children }: PropsWithChildrenOnly) { const { handleRetry: doHandleRetry, diff --git a/src/context/MessageContext.tsx b/src/context/MessageContext.tsx index 257671be1d..f0db2eea70 100644 --- a/src/context/MessageContext.tsx +++ b/src/context/MessageContext.tsx @@ -21,7 +21,7 @@ import type { RenderTextOptions } from '../components/Message/renderText'; import type { DefaultStreamChatGenerics, UnknownType } from '../types/types'; export type CustomMessageActions< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { [key: string]: ( message: StreamMessage, @@ -30,7 +30,7 @@ export type CustomMessageActions< }; export type MessageContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { /** If actions such as edit, delete, flag, mute are enabled on Message */ actionsEnabled: boolean; @@ -143,20 +143,20 @@ export type MessageContextValue< export const MessageContext = React.createContext(undefined); export const MessageProvider = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, value, }: PropsWithChildren<{ value: MessageContextValue; }>) => ( - + {children} ); export const useMessageContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( // eslint-disable-next-line @typescript-eslint/no-unused-vars _componentName?: string, @@ -167,7 +167,7 @@ export const useMessageContext = < return {} as MessageContextValue; } - return (contextValue as unknown) as MessageContextValue; + return contextValue as unknown as MessageContextValue; }; /** @@ -177,7 +177,7 @@ export const useMessageContext = < */ export const withMessageContext = < P extends UnknownType, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( Component: React.ComponentType

, ) => { diff --git a/src/context/MessageInputContext.tsx b/src/context/MessageInputContext.tsx index 0869fd9922..95228c9ecb 100644 --- a/src/context/MessageInputContext.tsx +++ b/src/context/MessageInputContext.tsx @@ -13,7 +13,7 @@ import type { CustomTrigger, DefaultStreamChatGenerics } from '../types/types'; export type MessageInputContextValue< StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, > = MessageInputState & MessageInputHookProps & Omit, 'Input'> & @@ -28,7 +28,7 @@ export const MessageInputContext = createContext< export const MessageInputContextProvider = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >({ children, value, @@ -42,7 +42,7 @@ export const MessageInputContextProvider = < export const useMessageInputContext = < StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, - V extends CustomTrigger = CustomTrigger + V extends CustomTrigger = CustomTrigger, >( componentName?: string, ) => { diff --git a/src/context/PollContext.tsx b/src/context/PollContext.tsx index 229287611b..9d67d19f00 100644 --- a/src/context/PollContext.tsx +++ b/src/context/PollContext.tsx @@ -3,7 +3,7 @@ import type { Poll } from 'stream-chat'; import type { DefaultStreamChatGenerics } from '../types'; export type PollContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { poll: Poll; }; @@ -11,7 +11,7 @@ export type PollContextValue< export const PollContext = React.createContext(undefined); export const PollProvider = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, poll, @@ -19,14 +19,14 @@ export const PollProvider = < poll: Poll; }>) => poll ? ( - + {children} ) : null; export const usePollContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >() => { const contextValue = useContext(PollContext); - return (contextValue as unknown) as PollContextValue; + return contextValue as unknown as PollContextValue; }; diff --git a/src/context/TypingContext.tsx b/src/context/TypingContext.tsx index 73d7b56fc0..4028666cfd 100644 --- a/src/context/TypingContext.tsx +++ b/src/context/TypingContext.tsx @@ -5,7 +5,7 @@ import type { ChannelState as StreamChannelState } from 'stream-chat'; import type { DefaultStreamChatGenerics, UnknownType } from '../types/types'; export type TypingContextValue< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { typing?: StreamChannelState['typing']; }; @@ -13,20 +13,20 @@ export type TypingContextValue< export const TypingContext = React.createContext(undefined); export const TypingProvider = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ children, value, }: PropsWithChildren<{ value: TypingContextValue; }>) => ( - + {children} ); export const useTypingContext = < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( componentName?: string, ) => { @@ -50,7 +50,7 @@ export const useTypingContext = < */ export const withTypingContext = < P extends UnknownType, - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >( Component: React.ComponentType

, ) => { diff --git a/src/experimental/MessageActions/MessageActions.tsx b/src/experimental/MessageActions/MessageActions.tsx index 26cc0c45cf..67cdeab643 100644 --- a/src/experimental/MessageActions/MessageActions.tsx +++ b/src/experimental/MessageActions/MessageActions.tsx @@ -1,4 +1,3 @@ - import clsx from 'clsx'; import React, { PropsWithChildren, useState } from 'react'; @@ -14,9 +13,7 @@ import { defaultMessageActionSet } from './defaults'; export type MessageActionSetItem = { Component: React.ComponentType; placement: 'quick' | 'dropdown'; - type: - | keyof typeof MESSAGE_ACTIONS - | (string & {}); + type: keyof typeof MESSAGE_ACTIONS | (string & {}); }; export type MessageActionsProps = { diff --git a/src/experimental/MessageActions/hooks/useBaseMessageActionSetFilter.ts b/src/experimental/MessageActions/hooks/useBaseMessageActionSetFilter.ts index 01fd927024..dbbd2df26f 100644 --- a/src/experimental/MessageActions/hooks/useBaseMessageActionSetFilter.ts +++ b/src/experimental/MessageActions/hooks/useBaseMessageActionSetFilter.ts @@ -16,16 +16,8 @@ export const useBaseMessageActionSetFilter = ( disable = false, ) => { const { initialMessage: isInitialMessage, message } = useMessageContext(); - const { - canDelete, - canEdit, - canFlag, - canMarkUnread, - canMute, - canQuote, - canReact, - canReply, - } = useUserRole(message); + const { canDelete, canEdit, canFlag, canMarkUnread, canMute, canQuote, canReact, canReply } = + useUserRole(message); const isMessageThreadReply = typeof message.parent_id === 'string'; return useMemo(() => { diff --git a/src/i18n/__tests__/Streami18n.test.js b/src/i18n/__tests__/Streami18n.test.js index c84c183400..22966ef998 100644 --- a/src/i18n/__tests__/Streami18n.test.js +++ b/src/i18n/__tests__/Streami18n.test.js @@ -1,5 +1,5 @@ /* eslint-disable sort-keys */ - + import { Streami18n } from '../Streami18n'; import { nanoid } from 'nanoid'; import { default as Dayjs } from 'dayjs'; @@ -10,9 +10,8 @@ import localeData from 'dayjs/plugin/localeData'; Dayjs.extend(localeData); const customDayjsLocaleConfig = { - months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split( - '_', - ), + months: + 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'), diff --git a/src/i18n/utils.ts b/src/i18n/utils.ts index 978fd09cd9..5dc25177e1 100644 --- a/src/i18n/utils.ts +++ b/src/i18n/utils.ts @@ -91,40 +91,42 @@ export function getDateString({ } export const predefinedFormatters: PredefinedFormatters = { - timestampFormatter: (streamI18n) => ( - value, - _, - { - calendarFormats, - ...options - }: Pick & { - calendarFormats?: Record | string; - }, - ) => { - let parsedCalendarFormats; - try { - if (!options.calendar) { - parsedCalendarFormats = {}; - } else if (typeof calendarFormats === 'string') { - parsedCalendarFormats = JSON.parse(calendarFormats); - } else if (typeof calendarFormats === 'object') { - parsedCalendarFormats = calendarFormats; + timestampFormatter: + (streamI18n) => + ( + value, + _, + { + calendarFormats, + ...options + }: Pick & { + calendarFormats?: Record | string; + }, + ) => { + let parsedCalendarFormats; + try { + if (!options.calendar) { + parsedCalendarFormats = {}; + } else if (typeof calendarFormats === 'string') { + parsedCalendarFormats = JSON.parse(calendarFormats); + } else if (typeof calendarFormats === 'object') { + parsedCalendarFormats = calendarFormats; + } + } catch (e) { + console.error('[TIMESTAMP FORMATTER]', e); } - } catch (e) { - console.error('[TIMESTAMP FORMATTER]', e); - } - const result = getDateString({ - ...options, - calendarFormats: parsedCalendarFormats, - messageCreatedAt: value, - tDateTimeParser: streamI18n.tDateTimeParser, - }); - if (!result || typeof result === 'number') { - return JSON.stringify(value); - } - return result; - }, + const result = getDateString({ + ...options, + calendarFormats: parsedCalendarFormats, + messageCreatedAt: value, + tDateTimeParser: streamI18n.tDateTimeParser, + }); + if (!result || typeof result === 'number') { + return JSON.stringify(value); + } + return result; + }, }; export const defaultTranslatorFunction: TFunction = (key: tResult) => key; diff --git a/src/mock-builders/generator/attachment.js b/src/mock-builders/generator/attachment.js index 74fd887817..5d336dca3e 100644 --- a/src/mock-builders/generator/attachment.js +++ b/src/mock-builders/generator/attachment.js @@ -45,7 +45,7 @@ export const generateLocalImageUploadAttachmentData = (overrides, attachmentData ...generateLocalFileUploadAttachmentData().localMetadata, previewUri: 'image-preview-uri', ...overrides, - + file: generateImageFile(overrides?.file ?? {}), }, type: 'image', @@ -96,106 +96,31 @@ export const generateVoiceRecordingAttachment = (a) => ({ title: 'audio_recording_Mon Feb 05 16:21:34 PST 2024.aac', type: 'voiceRecording', waveform_data: [ - 0.3139950633049011, - 0.24018539488315582, - 0.27728691697120667, - 0.2946733236312866, - 0.18365363776683807, - 0.4870237708091736, - 0.5902017951011658, - 0.43630164861679077, - 0.4746025502681732, - 0.2663217782974243, - 0.7870231866836548, - 0.6237155795097351, - 0.36374375224113464, - 0.2663217782974243, - 0.6613287329673767, - 0.8278987407684326, - 0.1516059935092926, - 0.37934044003486633, - 0.5281689167022705, - 0.47579875588417053, - 0.48600485920906067, - 0.6229274868965149, - 0.4964161813259125, - 0.4377916753292084, - 0.5569855570793152, - 0.5540405511856079, - 0.4095909595489502, - 0.747698187828064, - 0.8532787561416626, - 0.6344320178031921, - 0.5756412744522095, - 0.529367208480835, - 0.8330334424972534, - 0.8681668043136597, - 0.6670080423355103, - 0.7732296586036682, - 0.7542996406555176, - 0.6666833758354187, - 0.4648399353027344, - 0.4689463675022125, - 0.515621542930603, - 0.7782987952232361, - 0.6618493795394897, - 0.6291788220405579, - 0.7447969317436218, - 0.7329777479171753, - 0.7156173586845398, - 0.8810608386993408, - 0.07107513397932053, - 0.07438423484563828, - 0.08600494265556335, - 0.1429901123046875, - 0.059566497802734375, - 0.032375335693359375, - 0.14445610344409943, - 0.9534039497375488, - 0.8612125515937805, - 0.4861070513725281, - 0.5025619864463806, - 0.3678266108036041, - 0.5829864144325256, - 0.6209651231765747, - 0.6576777696609497, - 0.6046710014343262, - 0.08803673088550568, - 0.492523193359375, - 0.1947961449623108, - 0.09975242614746094, - 0.03940269351005554, - 0.372602641582489, - 0.4425804913043976, - 0.6269233226776123, - 0.7768490314483643, - 0.41689178347587585, - 0.18697471916675568, - 0.11767738312482834, - 0.049776915460824966, - 0.1377594769001007, - 0.08291183412075043, - 0.05717025697231293, - 0.01960846036672592, - 0.04073379561305046, - 0.2909153699874878, - 0.2615521252155304, - 0.1473514586687088, - 0.8678494095802307, - 0.9467474222183228, - 0.7687522768974304, - 0.8469597101211548, - 0.6312726736068726, - 0.5455475449562073, - 0.8171653747558594, - 0.7835009694099426, - 0.6183612942695618, - 0.7298175692558289, - 0.6681936383247375, - 0.815593957901001, - 0.7774609327316284, - 0.8033567070960999, - 0.8980446457862854, + 0.3139950633049011, 0.24018539488315582, 0.27728691697120667, 0.2946733236312866, + 0.18365363776683807, 0.4870237708091736, 0.5902017951011658, 0.43630164861679077, + 0.4746025502681732, 0.2663217782974243, 0.7870231866836548, 0.6237155795097351, + 0.36374375224113464, 0.2663217782974243, 0.6613287329673767, 0.8278987407684326, + 0.1516059935092926, 0.37934044003486633, 0.5281689167022705, 0.47579875588417053, + 0.48600485920906067, 0.6229274868965149, 0.4964161813259125, 0.4377916753292084, + 0.5569855570793152, 0.5540405511856079, 0.4095909595489502, 0.747698187828064, + 0.8532787561416626, 0.6344320178031921, 0.5756412744522095, 0.529367208480835, + 0.8330334424972534, 0.8681668043136597, 0.6670080423355103, 0.7732296586036682, + 0.7542996406555176, 0.6666833758354187, 0.4648399353027344, 0.4689463675022125, + 0.515621542930603, 0.7782987952232361, 0.6618493795394897, 0.6291788220405579, + 0.7447969317436218, 0.7329777479171753, 0.7156173586845398, 0.8810608386993408, + 0.07107513397932053, 0.07438423484563828, 0.08600494265556335, 0.1429901123046875, + 0.059566497802734375, 0.032375335693359375, 0.14445610344409943, 0.9534039497375488, + 0.8612125515937805, 0.4861070513725281, 0.5025619864463806, 0.3678266108036041, + 0.5829864144325256, 0.6209651231765747, 0.6576777696609497, 0.6046710014343262, + 0.08803673088550568, 0.492523193359375, 0.1947961449623108, 0.09975242614746094, + 0.03940269351005554, 0.372602641582489, 0.4425804913043976, 0.6269233226776123, + 0.7768490314483643, 0.41689178347587585, 0.18697471916675568, 0.11767738312482834, + 0.049776915460824966, 0.1377594769001007, 0.08291183412075043, 0.05717025697231293, + 0.01960846036672592, 0.04073379561305046, 0.2909153699874878, 0.2615521252155304, + 0.1473514586687088, 0.8678494095802307, 0.9467474222183228, 0.7687522768974304, + 0.8469597101211548, 0.6312726736068726, 0.5455475449562073, 0.8171653747558594, + 0.7835009694099426, 0.6183612942695618, 0.7298175692558289, 0.6681936383247375, + 0.815593957901001, 0.7774609327316284, 0.8033567070960999, 0.8980446457862854, ], ...a, }); @@ -251,56 +176,49 @@ export const generateGiphyAttachment = (a) => ({ frames: '', height: '200', size: '445149', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200.gif&ct=g', width: '200', }, fixed_height_downsampled: { frames: '', height: '200', size: '148168', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200_d.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200_d.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200_d.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200_d.gif&ct=g', width: '200', }, fixed_height_still: { frames: '', height: '200', size: '23240', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200_s.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200_s.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200_s.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200_s.gif&ct=g', width: '200', }, fixed_width: { frames: '', height: '200', size: '445149', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w.gif&ct=g', width: '200', }, fixed_width_downsampled: { frames: '', height: '200', size: '148168', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w_d.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w_d.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w_d.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w_d.gif&ct=g', width: '200', }, fixed_width_still: { frames: '', height: '200', size: '23240', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w_s.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w_s.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/200w_s.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=200w_s.gif&ct=g', width: '200', }, original: { frames: '20', height: '400', size: '1308571', - url: - 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/giphy.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=giphy.gif&ct=g', + url: 'https://media2.giphy.com/media/j5L4RHeV8Q5tmepRVb/giphy.gif?cid=c4b03675kgziudvt7s9990i28hp8zpffi4oyem1snvl7sfvl&rid=giphy.gif&ct=g', width: '400', }, }, diff --git a/src/mock-builders/generator/channel.js b/src/mock-builders/generator/channel.js index 2fcabce2a7..889ff9e250 100644 --- a/src/mock-builders/generator/channel.js +++ b/src/mock-builders/generator/channel.js @@ -11,10 +11,10 @@ export const generateChannel = (options = { channel: {} }) => { messages: [], pinnedMessages: [], ...optionsBesidesChannel, - + channel: { cid: `${type}:${id}`, - + config: { automod: 'disabled', automod_behavior: 'flag', diff --git a/src/mock-builders/index.js b/src/mock-builders/index.js index e90be9f8ab..bad58123f0 100644 --- a/src/mock-builders/index.js +++ b/src/mock-builders/index.js @@ -1,4 +1,3 @@ - /* eslint-disable no-underscore-dangle */ import { StreamChat } from 'stream-chat'; import { nanoid } from 'nanoid'; diff --git a/src/mock-builders/utils.js b/src/mock-builders/utils.js index 0b1f32d435..0d8f943c53 100644 --- a/src/mock-builders/utils.js +++ b/src/mock-builders/utils.js @@ -45,7 +45,6 @@ export const initClientWithChannels = async ({ channelsData, customUser } = {}) ...channelData, }); - useMockedApis(client, [getOrCreateChannelApi(mockedChannelData)]); const channel = client.channel(mockedChannelData.channel.type, mockedChannelData.channel.id); await channel.watch(); diff --git a/src/store/hooks/useStateStore.ts b/src/store/hooks/useStateStore.ts index 0e2b09c513..a74bfe9d1f 100644 --- a/src/store/hooks/useStateStore.ts +++ b/src/store/hooks/useStateStore.ts @@ -4,15 +4,15 @@ import type { StateStore } from 'stream-chat'; export function useStateStore< T extends Record, - O extends Readonly | Readonly> + O extends Readonly | Readonly>, >(store: StateStore, selector: (v: T) => O): O; export function useStateStore< T extends Record, - O extends Readonly | Readonly> + O extends Readonly | Readonly>, >(store: StateStore | undefined, selector: (v: T) => O): O | undefined; export function useStateStore< T extends Record, - O extends Readonly | Readonly> + O extends Readonly | Readonly>, >(store: StateStore | undefined, selector: (v: T) => O) { const [state, setState] = useState(() => { if (!store) return undefined; diff --git a/src/stories/add-message.stories.tsx b/src/stories/add-message.stories.tsx index 31fc8fa9d6..082873d48c 100644 --- a/src/stories/add-message.stories.tsx +++ b/src/stories/add-message.stories.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import type { ChannelSort } from 'stream-chat'; import { diff --git a/src/stories/edit-message.stories.tsx b/src/stories/edit-message.stories.tsx index 88789916a1..6ad1319848 100644 --- a/src/stories/edit-message.stories.tsx +++ b/src/stories/edit-message.stories.tsx @@ -35,8 +35,7 @@ const Controls = () => { type: 'image', }, ], - text: - 'chat: https://getstream.io/chat/\nactivity-feeds: https://getstream.io/activity-feeds/', + text: 'chat: https://getstream.io/chat/\nactivity-feeds: https://getstream.io/activity-feeds/', }) } > diff --git a/src/stories/hello.stories.tsx b/src/stories/hello.stories.tsx index aa939e6604..179025d8a6 100644 --- a/src/stories/hello.stories.tsx +++ b/src/stories/hello.stories.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import type { ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat'; import { diff --git a/src/stories/jump-to-message.stories.tsx b/src/stories/jump-to-message.stories.tsx index 2f61479c75..86d0094d97 100644 --- a/src/stories/jump-to-message.stories.tsx +++ b/src/stories/jump-to-message.stories.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import { Channel, diff --git a/src/stories/mark-read.stories.tsx b/src/stories/mark-read.stories.tsx index bdb617d758..5865e7adad 100644 --- a/src/stories/mark-read.stories.tsx +++ b/src/stories/mark-read.stories.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import type { ChannelSort } from 'stream-chat'; import { nanoid } from 'nanoid'; diff --git a/src/stories/message-status-readby-tooltip.stories.tsx b/src/stories/message-status-readby-tooltip.stories.tsx index 1582841b12..d856ee7050 100644 --- a/src/stories/message-status-readby-tooltip.stories.tsx +++ b/src/stories/message-status-readby-tooltip.stories.tsx @@ -1,4 +1,3 @@ - import React, { useCallback } from 'react'; import type { ChannelSort } from 'stream-chat'; import { diff --git a/src/stories/pin-message.stories.tsx b/src/stories/pin-message.stories.tsx index a41b5318e3..fb7027a83c 100644 --- a/src/stories/pin-message.stories.tsx +++ b/src/stories/pin-message.stories.tsx @@ -18,9 +18,7 @@ const PinnedMessagesList = () => { return (

    - {pinnedMessages?.map((pm) => ( -
  • {pm.text}
  • - ))} + {pinnedMessages?.map((pm) =>
  • {pm.text}
  • )}
); }; diff --git a/src/utils/getChannel.ts b/src/utils/getChannel.ts index d47784ada6..8e71f80aaa 100644 --- a/src/utils/getChannel.ts +++ b/src/utils/getChannel.ts @@ -16,7 +16,7 @@ const WATCH_QUERY_IN_PROGRESS_FOR_CHANNEL: Record< > = {}; type GetChannelParams< - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, > = { client: StreamChat; channel?: Channel; @@ -35,7 +35,7 @@ type GetChannelParams< * @param channel */ export const getChannel = async < - StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics + StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, >({ channel, client, @@ -56,8 +56,8 @@ export const getChannel = async < const originalCid = theChannel?.id ? theChannel.cid : members && members.length - ? generateChannelTempCid(theChannel.type, members) - : undefined; + ? generateChannelTempCid(theChannel.type, members) + : undefined; if (!originalCid) { throw new Error('Channel ID or channel members array have to be provided to query a channel.'); From e0dfe4df8c47069f1d58a0ca3bf35481d2c865da Mon Sep 17 00:00:00 2001 From: Anton Arnautov Date: Sat, 7 Dec 2024 18:30:59 +0100 Subject: [PATCH 3/3] Drop Node v16 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68051d6de3..39db72adb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [16, 18] + node: [18, 20] name: Test with Node ${{ matrix.node }} steps: - uses: actions/checkout@v3