Commit graph

27 commits

Author SHA1 Message Date
Merlijn Vos
3393b537d3
Upgrade Yarn to 4.x (#4849)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-29 18:49:02 +02:00
Younes
5d2dd5eb51
@uppy/dashboard: add missing x-zip-compress archive type (#5081)
Add missing `x-zip-compress` archive type in `getFileTypeIcon.tsx`.
2024-04-15 17:08:17 +02:00
Antoine du Hamel
5fcdd8f275
@uppy/dashboard: refactor to TypeScript (#4984)
Co-authored-by: Murderlon <merlijn@soverin.net>
2024-03-20 13:23:56 +01:00
Antoine du Hamel
2c432b12cd
test: migrate to Vitest for Uppy core and Uppy plugins (#4700) 2023-09-26 17:23:17 +02:00
LinusMain
38de438864
Migrate all lodash' per-method-packages usage to lodash. (#4274)
Fixes: https://github.com/transloadit/uppy/issues/4272
Co-authored-by: R <r@r.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-06-19 15:45:28 +02:00
Antoine du Hamel
9190ed5f43
@uppy/dashboard: change copyToClipboard signature (#3933) 2022-08-01 17:58:42 +02:00
Antoine du Hamel
327509a7dc
@uppy/dashboard: refactor to ESM (#3701) 2022-05-18 10:17:27 +02:00
Antoine du Hamel
ec87b232e9
meta: enforce no-unused-vars linter rule (#3118)
* meta: enforce `no-unused-vars` linter rule

* meta: fix `@typescript-eslint/no-unused-vars` linter warnings

* meta: enforce `no-unused-expressions` lint rule

* @uppy/companion: fix `tsc` build
2021-08-23 13:10:17 +01:00
Antoine du Hamel
6b7ad5e7c7
Stricter linter (#3095)
* enforce some eslint rules

* enforce accessibility linter rules

* harden lint rules with only 1 or 2 warnings

* fix remaining rules with less than 3 warnings

* fix e2e tests

* fix remaining rules with less than 4 warnings

* fix remaining rules with less than 6 warnings

* fix `shuffleTaglines`

* fix companion build
2021-08-17 20:32:57 +02:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Ian VanSchooten
c77ddaa48e
Remove double-slash from import (#2888) 2021-05-14 10:55:08 +01:00
Kevin van Zonneveld
764c2ccada
Update Linter (#2796)
* relocate .vscode

* Switch to transloadit linter

* Update .eslintrc.json

* autofix code

* unlink and install eslint-config-transloadit@1.1.1

* Change 0 to "off"

* Don't change 'use strict'

* Do not vertically align

* disable key-spacing

* add import/no-extraneous-dependencies per package

* add more react/a11y warnings

* Revert "autofix code"

This reverts commit 14c8a8cde8.

* add import/no-extraneous-dependencies per example and main package

* autofix code (2)

* Allow devDependencies in ./bin

* Change import/no-extraneous-dependencies to warn again

* upgrade linter

* Set import/no-extraneous-dependencies to warn
2021-03-15 16:25:17 +00:00
Ahmed Kandil
916d4d7eaa
utils: Add archive mime types (#2703)
Resolves #2702
2020-12-18 21:09:18 +00:00
Ifedapo .A. Olarewaju
d586a4cf53
companion,unsplash: Unsplash provider (#2431)
* unsplash[wip]: implement unsplash provider + plugin

* unsplash,provider-views,companion-client: fully working unsplash plugin

* unsplash: clean up plugin implementation

* provider-views: refactor CloseWrapper

* companion-client: encode search text before adding it to URL

Co-authored-by: Renée Kooi <renee@kooi.me>

* companion: use object spread over Object.assign

Co-authored-by: Renée Kooi <renee@kooi.me>

* zoom: fix provider-view import

* circle icon

* update locale strings and package-lock

* move truncateString to @uppy/utils and use it for Unsplash name-description conversion, adding .jpg

* use alt_description if description in null

* companion: handle name truncation internally

* companion: handling carriage for truncation + fix urlmeta import

Co-authored-by: Renée Kooi <renee@kooi.me>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-10-28 19:50:51 +01:00
Artur Paikin
68f36b1ac2
Refactor FileProgress component (#2303)
* refactor FileProgress component; pass hideCancelButton, hidePauseResumeButton and hideRetryButton

* move icons to where they are rendered, rename UppyIcon to uppy-u-icon

* cleanup: rename DashboardItem, remove xmlns

* update docs to specify the option also hides action button on each individual file
2020-06-06 04:10:01 +02:00
Artur Paikin
41af1995c2
Dashboard: Add image and archive icons (#2027)
* Add image and archive icons

* Refactor archiveTypes
2020-01-17 17:14:20 +03:00
Renée Kooi
1463ee79ce
Improve performance of adding and removing files (#1949)
* core: add an addFiles() method that only updates state once

Previously, adding 1300-ish files took around 260ms, and looked like
this in Firefox's performance tab:

![Flamegraph](https://i.imgur.com/08veuoU.png)

All of the downward peaks are `setState()` calls and GC.

Now it takes around 60ms, and looks like this:

![Flamegraph](https://i.imgur.com/xFdwVBV.png)

Here, most of the time is spent generating file IDs and guessing file
types. Those would be areas to look at next.

* dashboard: prevent frequent state update if nothing changed

After the last commit, `addFiles()` still spends a lot of time in
`emit()` and `hideAllPanels()`. The reason is that `addFiles()` still
emits all the hundreds of file-added events, and the Dashboard responds
to each with `hideAllPanels()`, which does a state update. But this all
happens synchronously, and the state almost certainly did not change
since the last `file-added` event that fired a millisecond ago.

This adds a check to avoid the state update if it is not necessary.

![Flamegraph](https://i.imgur.com/KhuD035.png)

Adding 1300 files takes about 40ms now.

With this change, the `addFiles()` call is no longer the slowest
part—now preact rendering all the items is!

* utils: optimize generateFileID and getFileNameAndExtension

Replaces some clever things with more mundane and faster things!

Now, generateFileID is a bunch of string concatenations.
Now, getFileNameAndExtension uses `lastIndexOf()` instead of a regex.

![Flamegraph](https://i.imgur.com/ZQ1IhxI.png)

Adding 1300 files takes about 25ms.

* dashboard: use preact-virtual-list

* thumbnail-generator: add `lazy` option

* dashboard: request thumbnails once file item renders the first time

* dashboard: fork preact-virtual-list

* core: add removeFiles() to remove files in bulk

* Implement removeFile() in terms of removeFiles()

* thumbnail-generator: only queue files that can be previewed

* rename size constants to accommodate WIDTH/HEIGHT

* Use new uppy.addFiles in DragDrop and FileInput

* utils: fix getFileNameAndExtension() type

* Rip out the lazy thumbnail generation

* Rip out virtualization.

* Remove virtualization leftovers

* tell future people that this is intentionally verbose

* Update package-lock.json

* henlo i am spell

* Make `addFiles()` respect maxNumberOfFiles

* core: show an informer error if some files fail in bulk add

* locales: fix quotes to make build:locale-pack happy

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-01-13 12:29:08 +01:00
Renée Kooi
733de659da
Upgrade standard to v14 (#1860)
* Update eslint dependencies.

* standard --fix

* build: disable handler name lint rule

* status-bar: manually fix lint errors

* webcam: manually fix lint errors

* url: manually fix lint errors

* react-native: manually fix lint errors

* dashboard: manually fix lint errors

* informer: manually fix linting errors

* progress-bar: manually fix lint errors

* provider-views: manually fix lint errors

* redux-dev-tools: manually fix lint errors

* build: disable buggy no-unused-vars rule

* examples: manually fix lint errors

* ` quotes for code things, ' for text things
2019-10-09 14:53:02 +02:00
Renée Kooi
fcfdf64d7e Dashboard performance improvements (#1671)
* dashboard: reduce rerendering of FileItems

* dashboard: move pure HOC to util file

* dashboard: memoize arrays passed to child elements too

* dashboard: fix memoize-one import when bundler used `module` key
2019-07-02 18:25:53 +03:00
Alexander Zaytsev
3b4547fa2c More design improvements (#1574)
* Better focus styles

* Improve focus on the remove button

* "Add more" caption to the "+" button (todo: i18n)

* Add i18n (todo: check)

* Fix icon size

* Try removing file source (todo: remove icons)

* Simplify caption

* Revert "Try removing file source (todo: remove icons)"

This reverts commit 20c5ecb554.

* (WIP) Use icons for Edit / Copy link actions

* Class names optimizing

* Subtle shadows

* Optimize code, align action icons on smaller screens

* Reduce Tab-btn horizontal padding on mobile

* Fix padding

* i18n

* replace arabic with persian

* initial refactor

* primarily FileItem's css - reintegrated Alex's changes

* @uppy/dashboard - unnested subcomponents from ./components

* @uppy/dashboard scss - added some spacing as per conventions

* @uppy/dashboard - changed behaviour of truncateString() to always return a predictable number of symbols

* @uppy/dashboard - subdivided FileItem.js and its css into smaller files

Removed unused css classes, made filenames avoid overflow

* @uppy/dashboard - removed unused .currentWidth prop, FileItem.js - made fileName take up at most 2 lines

* test:endtoend:prepare-ci - fix test by reordering locale lines

* @uppy/dashboard - decorative FileItem.js changes

* @uppy/dashboard - made css of FileItem.js more flat

* @uppy/Dashboard - in FileItem.js made max filename length 30 symbols

* fix image getting width: 100% in DashboardFileCard

//cc @lakesare

* FileItem.scss - removed tagnames
2019-06-28 15:20:04 +03:00
Artur Paikin
81a45a01ed eslint jsdoc fixes 2019-06-25 18:27:48 +03:00
Evgenia Karunus
6bcf2040e9 Feature/accessibility (#1507)
* @uppy/provider-views - added accessibility

* @uppy/provider-views - simplified checkbox css

* @uppy/dashboard - on tab set focus to the current verlay

* @uppy/dashboard - factored out code related to focus into a separate file

* @uppy/dashboard, and connected plugins - made focus travel well, and be managed in a single place in Dashboard

* @uppy/dashboard - made modal opener button focus keep focus on modal close

* @uppy/dashboard - focus management for uploaded-files

* @uppy/dashboard - made informer read messages without interruption

* @uppy/provider-views - removed the bug of focus jumping on safari

* @uppy/dashboard - made focus travel well in instagram in firefox

* @uppy - moved lodash.debounce dependency from / to @uppy/dashboard

* everywhere - made <ul>s not focusable for firefox

* @uppy/provider-views - unnested scss, copypasted alex's :focus changes

* Added JSDoc eslint package and rules, and fixed some JSDoc comments

* .eslintrc - made jsdoc errors warnings instead

* package-lock.json for new package.json

* eslint fix

* @uppy/dashboard - avoid forcing focus when we are inline

* @uppy/dashboard - in firefox, made sure superfocus is not switching back to uppy

* @uppy/dashboard - no focus jump for .info() inline,  fix for firefox

Made focus not interrupt .info() when we are in the inline mode;
Made firefox start superfocusing when we either tab into, or click on some element in Uppy

* @uppy/dashboard - only listen to click/focus on uppy

* @uppy/dashboard - started trapping focus in inline mode too

* @uppy/dashboard - restricted trapFocus() event listener to this.el

* @uppy/core - started throttling progress emits.

1. To fix heat up in firefox
2. To fix focus in firefox

* @uppy/core - fixed tests by adding .flush()-s for progress emits

* @uppy/dashboard - stopped trapping focus in inline mode, made background inert

* @uppy/dashboard - added MutationObserver polyfill

* tests - made locale-packs.js pass

* REVERTED last 3 commits that introduced inert

Inert requires too many polyfills, atm tests fail in IE 10.0, wicg-inert library reportedly has performance issues. We decided to at least wait until _some_ browser introduce inert html property natively.

* @uppy/dashboard - IE11 fix for focusing

* @uppy/dashboard - fix for a bug in Safari for long uploads with checkbox clicking

* RERUN TESTS - tiny commit to rerun tests

* @uppy/dashboard - removed useless touchstart event listener

* Cancel superFocus in recordIfFocusedOnUppyRecently, when focus moves away from Uppy

* @uppy/provider-views - made Filter not swallow letters

* @uppy/dashboard - stopped superfocus from refocusing if we're already in the overlay
2019-06-11 19:10:32 +03:00
Alexander Zaytsev
0a0ffa277e Tweak file format icons 2019-04-16 10:43:01 +03:00
Alexander Zaytsev
861fa37881 Default file icon 2019-04-16 10:29:00 +03:00
Alexander Zaytsev
f82ea241b7 Update file icons 2019-04-15 12:53:43 +03:00
Artur Paikin
69343e68bd add ignoreEvent — so that paste/drop events are not passed to Url plugin
ignore drop/paste events if they are not in input or textarea —
otherwise when Url plugin adds drop/paste listeners to this.el,
draging UI elements or pasting anything into any field triggers those events — Url treats them as URLs that need to be imported

// @goto-bus-stop could you check this when you are back, what do you think
2018-07-30 11:41:00 -04:00
Artur Paikin
5ddac3a0b7 group things into components and utils 2018-07-30 11:38:00 -04:00