[Dev] Update dependencies (#1825)

This commit is contained in:
Alexander Zinchuk 2022-04-19 15:12:00 +02:00
parent f132faf7cd
commit c67560d431
14 changed files with 6887 additions and 3137 deletions

9930
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,45 +37,45 @@
"author": "Alexander Zinchuk (alexander@zinchuk.com)", "author": "Alexander Zinchuk (alexander@zinchuk.com)",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.5", "@babel/core": "^7.17.9",
"@babel/plugin-proposal-class-properties": "^7.16.7", "@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
"@babel/preset-env": "^7.16.11", "@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7", "@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7", "@babel/preset-typescript": "^7.16.7",
"@peculiar/webcrypto": "^1.3.2", "@peculiar/webcrypto": "^1.3.3",
"@statoscope/cli": "^5.20.1", "@statoscope/cli": "^5.20.1",
"@statoscope/webpack-plugin": "^5.20.1", "@statoscope/webpack-plugin": "^5.20.1",
"@testing-library/jest-dom": "^5.16.2", "@testing-library/jest-dom": "^5.16.4",
"@types/croppie": "^2.6.1", "@types/croppie": "^2.6.1",
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"@types/react": "^17.0.40", "@types/react": "^18.0.5",
"@types/react-dom": "^17.0.13", "@types/react-dom": "^18.0.0",
"@types/wicg-mediasession": "^1.1.3", "@types/wicg-mediasession": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^5.14.0", "@typescript-eslint/eslint-plugin": "^5.19.0",
"@typescript-eslint/parser": "^5.14.0", "@typescript-eslint/parser": "^5.19.0",
"@webpack-cli/serve": "^1.6.1", "@webpack-cli/serve": "^1.6.1",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.4",
"babel-loader": "^8.2.3", "babel-loader": "^8.2.4",
"browserlist": "^1.0.1", "browserlist": "^1.0.1",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1", "css-minimizer-webpack-plugin": "^3.4.1",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"eslint": "^8.10.0", "eslint": "^8.13.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.1", "eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-react-app": "^7.0.0", "eslint-config-react-app": "^7.0.1",
"eslint-import-resolver-webpack": "^0.13.2", "eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-no-async-without-await": "^1.2.0", "eslint-plugin-no-async-without-await": "^1.2.0",
"eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-react": "^7.29.3", "eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-teactn": "git+https://github.com/korenskoy/eslint-plugin-teactn#c2c39dd005d58c07c24c4361de804dce1c6261b5", "eslint-plugin-teactn": "git+https://github.com/korenskoy/eslint-plugin-teactn#c2c39dd005d58c07c24c4361de804dce1c6261b5",
"git-revision-webpack-plugin": "^5.0.0", "git-revision-webpack-plugin": "^5.0.0",
"gitlog": "^4.0.4", "gitlog": "^4.0.4",
@ -84,25 +84,25 @@
"jest": "^27.5.1", "jest": "^27.5.1",
"jest-raw-loader": "^1.0.1", "jest-raw-loader": "^1.0.1",
"jsdom": "^19.0.0", "jsdom": "^19.0.0",
"lint-staged": "^12.3.5", "lint-staged": "^12.3.7",
"mini-css-extract-plugin": "^2.6.0", "mini-css-extract-plugin": "^2.6.0",
"postcss-loader": "^6.2.1", "postcss-loader": "^6.2.1",
"postcss-modules": "^4.3.1", "postcss-modules": "^4.3.1",
"react": "^17.0.2", "react": "^18.0.0",
"replace-in-file": "^6.3.2", "replace-in-file": "^6.3.2",
"sass": "^1.49.9", "sass": "^1.50.0",
"sass-loader": "^12.6.0", "sass-loader": "^12.6.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"stylelint": "^14.5.3", "stylelint": "^14.6.1",
"stylelint-config-recommended-scss": "^5.0.2", "stylelint-config-recommended-scss": "^6.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.5.0", "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
"stylelint-group-selectors": "^1.0.8", "stylelint-group-selectors": "^1.0.8",
"stylelint-high-performance-animation": "^1.6.0", "stylelint-high-performance-animation": "^1.6.0",
"telegraph-node": "^1.0.4", "telegraph-node": "^1.0.4",
"typescript": "^4.6.2", "typescript": "^4.6.3",
"webpack": "^5.70.0", "webpack": "^5.72.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4", "webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"
}, },
"dependencies": { "dependencies": {
@ -121,6 +121,6 @@
"websocket": "^1.0.34" "websocket": "^1.0.34"
}, },
"optionalDependencies": { "optionalDependencies": {
"fsevents": "2.1.2" "fsevents": "2.3.2"
} }
} }

View File

@ -1,6 +1,7 @@
import React, { FC, memo, useCallback } from '../../lib/teact/teact'; import React, { FC, memo, useCallback } from '../../lib/teact/teact';
import { ApiMessage, ApiWebPage } from '../../api/types'; import { ApiMessage, ApiWebPage } from '../../api/types';
import { TextPart } from '../../types';
import { ObserveFn } from '../../hooks/useIntersectionObserver'; import { ObserveFn } from '../../hooks/useIntersectionObserver';
import { import {
@ -12,7 +13,7 @@ import trimText from '../../util/trimText';
import renderText from './helpers/renderText'; import renderText from './helpers/renderText';
import { formatPastTimeShort } from '../../util/dateFormat'; import { formatPastTimeShort } from '../../util/dateFormat';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';
import { renderMessageSummary, TextPart } from './helpers/renderMessageText'; import { renderMessageSummary } from './helpers/renderMessageText';
import Media from './Media'; import Media from './Media';
import Link from '../ui/Link'; import Link from '../ui/Link';

View File

@ -3,6 +3,8 @@ import React from '../../../lib/teact/teact';
import { import {
ApiChat, ApiMessage, ApiUser, ApiGroupCall, ApiChat, ApiMessage, ApiUser, ApiGroupCall,
} from '../../../api/types'; } from '../../../api/types';
import { TextPart } from '../../../types';
import { LangFn } from '../../../hooks/useLang'; import { LangFn } from '../../../hooks/useLang';
import { import {
getChatTitle, getChatTitle,
@ -11,7 +13,7 @@ import {
} from '../../../global/helpers'; } from '../../../global/helpers';
import trimText from '../../../util/trimText'; import trimText from '../../../util/trimText';
import { formatCurrency } from '../../../util/formatCurrency'; import { formatCurrency } from '../../../util/formatCurrency';
import { TextPart, renderMessageSummary } from './renderMessageText'; import { renderMessageSummary } from './renderMessageText';
import renderText from './renderText'; import renderText from './renderText';
import UserLink from '../UserLink'; import UserLink from '../UserLink';

View File

@ -1,4 +1,6 @@
import { ApiMessage, ApiMessageEntityTypes } from '../../../api/types'; import { ApiMessage, ApiMessageEntityTypes } from '../../../api/types';
import { TextPart } from '../../../types';
import { import {
getMessageSummaryDescription, getMessageSummaryDescription,
getMessageSummaryEmoji, getMessageSummaryEmoji,
@ -8,11 +10,9 @@ import {
} from '../../../global/helpers'; } from '../../../global/helpers';
import { LangFn } from '../../../hooks/useLang'; import { LangFn } from '../../../hooks/useLang';
import renderText from './renderText'; import renderText from './renderText';
import { renderTextWithEntities, TextPart } from './renderTextWithEntities'; import { renderTextWithEntities } from './renderTextWithEntities';
import trimText from '../../../util/trimText'; import trimText from '../../../util/trimText';
export type { TextPart };
export function renderMessageText( export function renderMessageText(
message: ApiMessage, message: ApiMessage,
highlight?: string, highlight?: string,

View File

@ -1,6 +1,8 @@
import React from '../../../lib/teact/teact'; import React from '../../../lib/teact/teact';
import EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex'; import EMOJI_REGEX, { removeVS16s } from '../../../lib/twemojiRegex';
import { TextPart } from '../../../types';
import { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config'; import { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config';
import { IS_EMOJI_SUPPORTED } from '../../../util/environment'; import { IS_EMOJI_SUPPORTED } from '../../../util/environment';
import { import {
@ -12,7 +14,6 @@ import { compact } from '../../../util/iteratees';
import MentionLink from '../../middle/message/MentionLink'; import MentionLink from '../../middle/message/MentionLink';
import SafeLink from '../SafeLink'; import SafeLink from '../SafeLink';
type TextPart = string | Element;
export type TextFilter = ( export type TextFilter = (
'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' | 'escape_html' | 'hq_emoji' | 'emoji' | 'emoji_html' | 'br' | 'br_html' | 'highlight' | 'links' |
'simple_markdown' | 'simple_markdown_html' 'simple_markdown' | 'simple_markdown_html'
@ -90,7 +91,7 @@ function replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx'
return textParts; return textParts;
} }
return textParts.reduce((result, part) => { return textParts.reduce((result: TextPart[], part: TextPart) => {
if (typeof part !== 'string') { if (typeof part !== 'string') {
result.push(part); result.push(part);
return result; return result;
@ -98,7 +99,7 @@ function replaceEmojis(textParts: TextPart[], size: 'big' | 'small', type: 'jsx'
part = fixNonStandardEmoji(part); part = fixNonStandardEmoji(part);
const parts = part.split(EMOJI_REGEX); const parts = part.split(EMOJI_REGEX);
const emojis = part.match(EMOJI_REGEX) || []; const emojis: string[] = part.match(EMOJI_REGEX) || [];
result.push(parts[0]); result.push(parts[0]);
return emojis.reduce((emojiResult: TextPart[], emoji, i) => { return emojis.reduce((emojiResult: TextPart[], emoji, i) => {

View File

@ -2,7 +2,9 @@ import { MouseEvent } from 'react';
import React from '../../../lib/teact/teact'; import React from '../../../lib/teact/teact';
import { getActions } from '../../../global'; import { getActions } from '../../../global';
import { TextPart } from '../../../types';
import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types'; import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types';
import renderText, { TextFilter } from './renderText'; import renderText, { TextFilter } from './renderText';
import { copyTextToClipboard } from '../../../util/clipboard'; import { copyTextToClipboard } from '../../../util/clipboard';
import { getTranslation } from '../../../util/langProvider'; import { getTranslation } from '../../../util/langProvider';
@ -11,10 +13,6 @@ import MentionLink from '../../middle/message/MentionLink';
import SafeLink from '../SafeLink'; import SafeLink from '../SafeLink';
import Spoiler from '../spoiler/Spoiler'; import Spoiler from '../spoiler/Spoiler';
export type TextPart =
string
| Element;
interface IOrganizedEntity { interface IOrganizedEntity {
entity: ApiMessageEntity; entity: ApiMessageEntity;
organizedIndexes: Set<number>; organizedIndexes: Set<number>;

View File

@ -1,9 +1,10 @@
import React, { FC, useEffect, useState } from '../../lib/teact/teact'; import React, { FC, useEffect, useState } from '../../lib/teact/teact';
import { TextPart } from '../../types';
import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';
import { throttle } from '../../util/schedulers'; import { throttle } from '../../util/schedulers';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';
import { TextPart } from '../common/helpers/renderMessageText';
import { REM } from '../common/helpers/mediaDimensions'; import { REM } from '../common/helpers/mediaDimensions';
import './MediaViewerFooter.scss'; import './MediaViewerFooter.scss';

View File

@ -2,8 +2,9 @@ import React, {
FC, memo, useCallback, useRef, FC, memo, useCallback, useRef,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { TextPart } from '../../types';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';
import { TextPart } from '../common/helpers/renderMessageText';
import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';
import Modal from './Modal'; import Modal from './Modal';

View File

@ -3,7 +3,7 @@ import React, {
FC, useEffect, useRef, FC, useEffect, useRef,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { TextPart } from '../common/helpers/renderMessageText'; import { TextPart } from '../../types';
import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import captureKeyboardListeners from '../../util/captureKeyboardListeners';
import trapFocus from '../../util/trapFocus'; import trapFocus from '../../util/trapFocus';

View File

@ -6,11 +6,12 @@ import React, {
useState, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { TextPart } from '../../types';
import { ANIMATION_END_DELAY } from '../../config'; import { ANIMATION_END_DELAY } from '../../config';
import useShowTransition from '../../hooks/useShowTransition'; import useShowTransition from '../../hooks/useShowTransition';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';
import captureEscKeyListener from '../../util/captureEscKeyListener'; import captureEscKeyListener from '../../util/captureEscKeyListener';
import { TextPart } from '../common/helpers/renderMessageText';
import Portal from './Portal'; import Portal from './Portal';

View File

@ -6,7 +6,7 @@ import TeactDOM from '../../lib/teact/teact-dom';
type OwnProps = { type OwnProps = {
containerId?: string; containerId?: string;
className?: string; className?: string;
children: React.ReactNode; children: VirtualElement;
}; };
const Portal: FC<OwnProps> = ({ containerId, className, children }) => { const Portal: FC<OwnProps> = ({ containerId, className, children }) => {
@ -34,7 +34,7 @@ const Portal: FC<OwnProps> = ({ containerId, className, children }) => {
}; };
}, [className, containerId]); }, [className, containerId]);
return TeactDOM.render(children as VirtualElement, elementRef.current); return TeactDOM.render(children, elementRef.current);
}; };
export default Portal; export default Portal;

View File

@ -1,8 +1,9 @@
import { ApiMessage, ApiMessageEntityTypes } from '../../api/types'; import { ApiMessage, ApiMessageEntityTypes } from '../../api/types';
import type { TextPart } from '../../components/common/helpers/renderTextWithEntities';
import { CONTENT_NOT_SUPPORTED } from '../../config'; import { CONTENT_NOT_SUPPORTED } from '../../config';
import { TextPart } from '../../types';
import { LangFn } from '../../hooks/useLang'; import { LangFn } from '../../hooks/useLang';
import trimText from '../../util/trimText'; import trimText from '../../util/trimText';
import { getMessageText } from './messages'; import { getMessageText } from './messages';
import { getMessageRecentReaction } from './reactions'; import { getMessageRecentReaction } from './reactions';

View File

@ -5,6 +5,8 @@ import {
ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet, ApiLanguage, ApiMessage, ApiShippingAddress, ApiStickerSet,
} from '../api/types'; } from '../api/types';
export type TextPart = string | JSX.Element;
export enum LoadMoreDirection { export enum LoadMoreDirection {
Backwards, Backwards,
Forwards, Forwards,