Skip to content

Commit

Permalink
v10.10.1
Browse files Browse the repository at this point in the history
Merge pull request #2093 from GetStream/develop
  • Loading branch information
arnautov-anton authored Sep 13, 2023
2 parents a767bf7 + 6de48be commit ac05488
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"react-virtuoso": "^2.16.5",
"remark-gfm": "^3.0.1",
"textarea-caret": "^3.1.0",
"tslib": "^2.6.2",
"unist-builder": "^3.0.0",
"unist-util-visit": "^4.1.1"
},
Expand Down Expand Up @@ -171,7 +172,6 @@
"stream-chat": "^8.4.1",
"style-loader": "^2.0.0",
"ts-jest": "^26.5.1",
"tslib": "2.3.0",
"typescript": "^4.7.4",
"url-loader": "^4.1.1",
"webpack": "4.44.2",
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ const basePlugins = ({ useBrowserResolve = false }) => [
copy({
targets: [
{ dest: 'dist/assets', src: './node_modules/@stream-io/stream-chat-css/dist/assets/*' },
{ dest: 'dist/css', src: './node_modules/@stream-io/stream-chat-css/dist/css/*' },
{ dest: 'dist/css', src: './node_modules/@stream-io/stream-chat-css/dist/css/*.css' },
{ dest: 'dist/scss', src: './node_modules/@stream-io/stream-chat-css/dist/scss/*' },
{ dest: 'dist/css/v2', src: './node_modules/@stream-io/stream-chat-css/dist/v2/css/*' },
{ dest: 'dist/css/v2', src: './node_modules/@stream-io/stream-chat-css/dist/v2/css/*.css' },
{ dest: 'dist/scss/v2', src: './node_modules/@stream-io/stream-chat-css/dist/v2/scss/*' },
],
verbose: process.env.VERBOSE,
Expand Down
25 changes: 15 additions & 10 deletions src/components/ReactFileUtilities/utils.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import type { FileLike } from './types';
import { ChangeEvent, useCallback } from 'react';

export const useHandleFileChangeWrapper = (
resetOnChange = false,
handler?: (files: Array<File>) => void,
) => ({ currentTarget }: React.ChangeEvent<HTMLInputElement>) => {
const { files } = currentTarget;
) =>
useCallback(
({ currentTarget }: ChangeEvent<HTMLInputElement>) => {
const { files } = currentTarget;

if (!files) return;
if (!files) return;

try {
handler?.(Array.from(files));
} catch (error) {
console.error(error);
}
try {
handler?.(Array.from(files));
} catch (error) {
console.error(error);
}

if (resetOnChange) currentTarget.value = '';
};
if (resetOnChange) currentTarget.value = '';
},
[handler, resetOnChange],
);

export function dataTransferItemsHaveFiles(items?: DataTransferItem[]): boolean {
if (!items || !items.length) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ export * from './Tooltip';
export * from './TypingIndicator';
export * from './UserItem';
export * from './Window';

export { UploadButton, UploadButtonProps } from './ReactFileUtilities';
23 changes: 6 additions & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"*": ["src/@types/*"]
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext", "DOM"],
"module": "esnext",
"moduleResolution": "node",
"lib": ["ESNext", "DOM"],
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
Expand All @@ -25,22 +20,16 @@
"strict": true,
"target": "ES5",
"allowSyntheticDefaultImports": true,
"noEmitOnError": false,
"noEmitOnError": true,
"noImplicitAny": true,
"allowJs": true,
"checkJs": false,
"outDir": "./dist",
"declaration": true,
"declarationDir": "./dist",
"declarationMap": true,
"types": ["vite/client"]
"importHelpers": true
},
"include": ["./src/**/*"],
"exclude": [
"./src/mock-builders",
"node_modules",
"babel.config.js",
"jest.config.js",
"**/__tests__/*.test.js"
]
"exclude": ["./src/stories", "./src/mock-builders", "./src/**/__tests__/*"]
}
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14044,11 +14044,6 @@ tsconfig-paths@^3.9.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

[email protected]:
version "2.3.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==

tslib@^1.8.1, tslib@^1.9.3:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand All @@ -14064,6 +14059,11 @@ tslib@^2.4.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

tslib@^2.6.2:
version "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"
Expand Down

0 comments on commit ac05488

Please sign in to comment.