Commit graph

46 commits

Author SHA1 Message Date
Artur Paikin
d202a8e940
audio: new @uppy/audio plugin for recording with microphone (#2976)
* add Audio plugin

* add audio-oscilloscope to visualize the recording

* refactor: rename everything to Audio, use oscilloscope, re-init when appropriate, improved preview screen

* tweak styles

* add @uppy/audio to the Uppy bundle

* update Readme and package.json

* add docs, update locales, add website example

* webcam plugin also shouldn’t show recording length counter on video preview screen

* update package.json and yarn.lock

* update types

* update locale

* fix locale issues

* remove leftover webcam test

* Delete index.test-d.ts

* Revert "Delete index.test-d.ts"

This reverts commit f4ec431f6a.

* fix lint and type tests

* Update website/src/docs/audio.md

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/audio-oscilloscope/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/DiscardButton.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/audio-oscilloscope/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/supportsMediaRecorder.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update website/src/docs/audio.md

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/types/index.d.ts

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/audio/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* remove unused method

* remove unused commented declarations

* make all methods private

* convert class component to hooks

* more private

* fix lint

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-06 17:06:51 +00:00
Mikael Finstad
56339fc3e5
Rewrite Companion providers to use streams to allow simultaneous upload/download without saving to disk (#3159)
* rewrite to async/await

* Only fetch size (HEAD) if needed #3034

* Update packages/@uppy/companion/src/server/controllers/url.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Change HEAD to GET in getURLMeta

and abort request immediately upon response headers received
https://github.com/transloadit/uppy/issues/3034#issuecomment-908059234

* fix lint

* fix lint

* cut off length of file names

or else we get
"MetadataTooLarge: Your metadata headers exceed the maximum allowed metadata size" in tus / S3

* try to fix flaky test

* remove iife and cleanup code a bit

* fix lint by reordering code

* rename Uploader to MultipartUploader

* Rewrite Uploader to use fs-capacitor #3098

This allows for upload to start almost immediately without having to first download the file.
And it allows for uploading bigger files, because transloadit assembly will not timeout,
as it will get upload progress events all the time.
No longer need for illusive progress.
Also fix eslint warnings and simplify logic

Still TODO: TUS pause/resume has a bug:
https://github.com/tus/tus-js-client/issues/275

* add comment in dev Dashboard and pull out variable

* fix a bug where remote xhr upload would ignore progress events in the UI

* fix bug where s3 multipart cancel wasn't working

* fix also cancel for xhr

* Rewrite providers to use streams

This removes the need for disk space as data will be buffered in memory and backpressure will be respected
https://github.com/transloadit/uppy/issues/3098#issuecomment-907763809
All providers "download" methods will now return a { stream } which can be consumed by uploader.

Also:
- Remove capacitor (no longer needed)
- Change Provider/SearchProvider API to async (Breaking change for custom companion providers)
- Fix the case with unknown length streams (zoom / google drive). Need to be downloaded first
- rewrite controllers deauth-callback, thumbnail, list, logout to async
- getURLMeta: make sure size is never NaN (NaN gets converted to null in JSON.stringify when sent to client but not when used in backend)
- fix purest mock (it wasn't returning statusCode on('response'))
- add missing http mock for "request" for THUMBNAIL_URL and http://url.myendpoint.com/file (these request errors were never caught by tests previously)
- "upload functions with tus protocol" test: move filename checking to new test where size is null. Fix broken expects
- fix some lint

* Implement streamingUpload flag

COMPANION_STREAMING_UPLOAD
Default to false due to backward compatibility
If set to true, will start to upload files at the same time as dowlnoading them, by piping the streams

- Also implement progress for downloading too
- and fix progress duplication logic
- fix test that assumed file was fully downloaded after first progress event

* rearrange validation logic

* add COMPANION_STREAMING_UPLOAD to env.test.sh too

* implement maxFileSize option in companion

for both unknown length and known length downloads

* fix bug

* fix memory leak when non 200 status

streams were being kept

* fix lint

* Add backward-compatibility for companion providers

Implement a new static field "version" on providers, which when not set to 2,
will cause a compatibility layer to be added for supporting old callback style provider api

also fix some eslint and rename some vars

* document new provider API

* remove static as it doesn't work on node 10

* try to fix build issue

* degrade to node 14 in github actions

due to hitting this error: https://github.com/nodejs/node/issues/40030
https://github.com/transloadit/uppy/pull/3159/checks?check_run_id=3544858518

* pull out duplicated logic into reusable function

* fix lint

* make methods private

* re-add unsplash download_location request

got lost in merge

* add try/catch

as suggested https://github.com/transloadit/uppy/pull/3159#discussion_r727149263

* Only set default chunkSize if needed

for being more compliant with previous behavior when streamingUpload = false

* Improve flaky test

Trying to fix this error:

FAIL packages/@uppy/utils/src/delay.test.js
  ● delay › should reject when signal is aborted

    expect(received).toBeLessThan(expected)

    Expected: < 70
    Received:   107

      32 |     const time = Date.now() - start
      33 |     expect(time).toBeGreaterThanOrEqual(30)
    > 34 |     expect(time).toBeLessThan(70)
         |                  ^
      35 |   })
      36 | })
      37 |

      at Object.<anonymous> (packages/@uppy/utils/src/delay.test.js:34:18)

https://github.com/transloadit/uppy/runs/3984613454?check_suite_focus=true

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* fix review feedback & lint

* Apply suggestions from code review

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* remove unneeded ts-ignore

* Update packages/@uppy/companion/src/server/controllers/url.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/Uploader.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* reduce nesting

* fix lint

* optimize promisify

https://github.com/transloadit/uppy/pull/3159#discussion_r738160576

* Update packages/@uppy/companion/test/__tests__/uploader.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-11-01 16:35:25 +07:00
Antoine du Hamel
01d7ea13e9
meta: use Yarn v3 instead of npm (#3237)
* meta: use Yarn v3 instead of npm

* Update CONTRIBUTING.md to fix linter errors

* remove remaining npm commands

* Update deps
2021-10-20 15:16:59 +02:00
Artur Paikin
17b361a286
Core: rename allowMultipleUploads to allowMultipleUploadBatches (#3115)
* allowNewUpload  --> allowMultipleUploadBatches

* noNewAlreadyUploading --> noMoreFilesAllowed

* Disallow drag-drop when allowNewUpload: false in Core

* Fix tests

* add deprecation notice to types

* Update Dashboard.js
2021-08-23 13:19:40 +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
Artur Paikin
172cc77f63 Merge master 2021-07-30 14:27:21 +01:00
Antoine du Hamel
56b84dfec7
Dashboard: add required option to metaFields (#2896)
* Dashboard: add `required` option to `metaFields`

Fixes: https://github.com/transloadit/uppy/issues/2892

* use `<form>` element to allow users to use all built-in form features
from the web browser.

* remove `saveOnEnter` hack

The fields are now inside a form, saving on Enter is the default
behavior – and it doesn't short-circuit form validation checks.

* restrictions.requiredMetaFields

* fix documentation of restrictions.requiredMetaFields

* check for required meta fields on upload

* Use detached `<form>` element to avoid nesting `<form>` elements

* fixup! Use detached `<form>` element to avoid nesting `<form>` elements

* Use `cuid` to generate `<form>` `id`
2021-07-29 13:15:36 +01:00
Antoine du Hamel
31438b0474
doc, deps: clean up polyfill inconsistencies (#3020) 2021-07-16 14:41:22 +02:00
Antoine du Hamel
fdd73d8df8
test: fix end2end test suite (#3008)
* @uppy/angular: fix `rxjs` dependency version conflict

* @uppy/companion: re-enable types checks on build

* test: fix undefined global var

* types: fix `Core` export

* examples/dev: add `browser-sync` as dependency
2021-07-14 14:10:20 +02:00
Antoine du Hamel
c315329399
Remove IE polyfills and special casing (#2947)
* Remove IE polyfills and special casing

* dashboard: remove `resize-observer-polyfill`

* deps: remove url-parse to use global `URL` instead

* Update documentation for browser support

* Add a migration guide

* Update e2e test platforms

* Remove polyfills from examples and add those missing in CDN bundle

* Use Node.js v16.x on CI because of `AbortController`

* Update bundle builder to produce two builds: `uppy.js` without polyfills, `uppy.legacy.js` with polyfills.

* Upgrade create-react-app deps

* remove null coalescing operator as it's not supported by the build chain

* disable Safari testing (for now)


Co-authored-by: Renée Kooi <renee@kooi.me>
2021-06-28 11:34:51 +02:00
Artur Paikin
1fcb99540c
Add @uppy/drop-target — drag and drop files on any existing DOM element (#2836)
* Add dom-target plugin

* add dom-target to bundle and website — had trouble with css otherwise

* cleanup and dev setup

* newline at the end, restore inline: false by default

* dom-target --> drop-target, remove paste

* add docs, bundle, website example

* add types

@goto-bus-stop this should probably be something other than Uppy.PluginTarget since it won’t accept an uppy plugin?

* fix types

* Update examples/dev/Dashboard.js

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

* type string | Element

* Update packages/@uppy/drop-target/package.json

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

* Update packages/@uppy/drop-target/package.json

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

* Update examples/dev/Dashboard.js

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

* Create package-lock.json

* Update package-lock.json

* Update package-lock.json

Co-authored-by: Renée Kooi <renee@kooi.me>
2021-03-31 16:29:03 +01:00
Renée Kooi
c1d15abf10
error on import lint failure + some misc lint fixes (#2813)
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2021-03-20 11:02:49 +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
Renée Kooi
1177e59c55
dev: add transloadit+S3, transloadit+XHR test uploaders 2021-02-12 11:41:08 +01:00
Renée Kooi
a03a1ed7d6
use tusd.tusdemo.net (#2691) 2020-12-16 15:08:40 +01:00
Carter Konz
970ac8df5b
companion,box: Box provider implementation (#2549)
* boilerplate for Box provider

TODO:
  - adapter
  - index
  - website/src/docs
  - tests

* Box provider implementation

- adapter
- index
- npm bufoonery
- lil' fixes

and MORE!

TODO:
- thumbnails 🤬
- tests
- docs

* Box provider: add brand icon, fix file icons

- token issues with thumbnail/logout

* Box provider: fix thumbnails, upload

- fix tokens for box
- implement `size()`
- make debug logging easier to find (bold blue)

learned:
- box needs cookie auth
- thumbnail requests come back as 202s

TODO:
- fix logout with form POST (zoom example)

* Box provider: fix logout

- add client info as formData to revoke post

TODO:
- tests cleanup
- package-lock fix
- docs

* Box provider: docs

TODO:
- tests

* Box provider: cleanup

TODO:
- tests

* fix error msg path for Box

- remove comment

* keeping up

- update ProviderViews import
- fix version string on Box package.json

* companion,box: exclude box from global module/examples while in beta

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-11-13 15:37:00 +01: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
Renée Kooi
ef5ba9c8fc
webcam: add video source selector (#2492)
* webcam: add showVideoSourceDropdown

* webcam: update video device list when adding/removing a video device

* webcam: cleaner changes

* delete extraneous file

* webcam: store sources data in state

* webcam: regather sources after getting access

* webcam: put the source selector next to the buttons

* webcam: put the video source selection on its own row in mobile view

* website: show webcam video source dropdown

* enable webcam features in dev example

* facingMode takes precedence over deviceId, and not needed when specific device is selected

fixes issue where on mobile (iOS) the device selection was ignored due to facingMode being set to 'user'

* Remove “video source” copy, style select, deal with iOS zoom-in issue

Co-authored-by: Tsy-Jon Lau <tlau@parsys.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-10-18 12:21:59 +01:00
Renée Kooi
06f561c691
Fix XHR upload demos, fixes #2517 (#2537) 2020-09-19 13:06:57 +03:00
mokutsu-coursera
f1ef5bd809
companion,zoom: add implementation for Zoom plugin and Zoom Provider (#2342)
* [WIP] First pass at adding zoom plugin and zoom companion service for allowing imports from zoom cloud

* WIP. Remove zoom example and move zoom companion code into core companion package, update list endpoint to retrieve based on pagination token or dates available, and get size / download endpoint working.

TO DO:
- fix logout / token expiry
- investigate why test for loading config from file is not working as expected
- confirm pagination works

* Modify provider views to allow for cases with zoom provider when insufficient results exist to enable infinite scroll (but users may need to retrieve older results), update types tests. Linters failing on the provider views files

* Update uppy and companion for the zoom integration to use folders to represent months, and retrieve 1 month at a time.

- clean up code around response data items to explicitly show fields, and match style of other provider methods
- update license date to 2020 across repo
- enable download/uploado of json timeline files
- fix companion test to load credentials from file
- remove front end code no longer required now that folders are being used instead of loading more with button

* Change initial check for user authentication to use same endpoint so we can reuse the same app permission list (ie dont require additional permissions to read user data)

* Clean up zoom provider index file, add api call back to retrieve user account information such as created timestamp and email, fix file icons, remove unused strings, remove license date updates from branch

* Add permission list to grant configurations, remove undefined response body check, update error to match style of other providers, reorder svg attribute to match other icons

* Add request to get user email address for when we are retrieving user meetings and meeting recordings within zoom provider, clean up logout api call

* Update adapter to use meeting UUID when returning the meeting id to match the meeting ID associated with the recording file meeting. This should also resolve issues around reused meeting IDs from zoom.

* Fix companion test

* uppy,robodog: do not add zoom yet

* zoom: add publishConfig

* test: remove uppy.Zoom use from typescript e2e test

Co-authored-by: Renée Kooi <renee@kooi.me>
2020-07-30 11:01:21 +01:00
Renée Kooi
8c826313b6
A few docs things (#2371) 2020-07-29 12:17:27 +02:00
Artur Paikin
b48757b50c update docs and dev example 2020-07-18 10:38:07 +01:00
Renée Kooi
5012eb4124
aws-s3-multipart: implement retries (#2312) 2020-07-13 15:10:23 +02:00
Renée Kooi
12715801ab
examples: add transloadit debug log to dev example 2020-05-25 14:34:04 +02:00
Artur Paikin
a6c8ef15e1
ScreenCapture plugin for screenshots / screen recordings (#2132)
* Finnish locale semantics improved

* Finnish semantics improved

* Screen capture initial commit

* Fix. Removed audio constraint from video.

* ui improvements

* so Lerna doesn’t try to publish as private

* refactor, tweak icons

* remove commented code from webcam styles

* Check for MediaRecorder (hides button in Safari) and refactor everything

* update readme

* beta for now

Co-authored-by: Miika Jukakoski <miika.jukakoski@ourmind.io>
2020-04-21 20:47:20 +02:00
Renée Kooi
3b54808cc7
Loosen metaFields.render types again to fix React/preact typings conflict 2020-04-01 13:04:34 +02:00
Renée Kooi
78003c2f5b
examples: fix s3 import path 2020-01-20 15:19:00 +01:00
Renée Kooi
419a27ddcb
examples: add some knobs to the dev example
Because I keep typing the same thing over and over again to test S3 or
Transloadit uploads for example. Figure it will be easier just to toggle
some of these values instead :)
2019-12-02 15:50:03 +01:00
Renée Kooi
a4c4486789
dev: add some easier config to the dev example 2019-12-02 15:50:03 +01:00
Artur Paikin
94cca0acc9 expose uppy on window for development, as before 2019-10-09 17:18:23 +03:00
ifedapoolarewaju
f1d6f6b6dc
companion,onedrive: implement OneDrive Provider plugin 2019-09-20 11:02:27 +01:00
Ifedapo .A. Olarewaju
3fed571c0a
Merge pull request #1794 from transloadit/facebook-provider
companion,facebook: add support for facebook provider
2019-09-20 11:00:48 +01:00
ifedapoolarewaju
c3ea4d384f
companion,facebook: add support for facebook provider 2019-08-22 14:50:48 +01:00
Artur Paikin
aa9b2edcd3
website: switch to the new upload-endpoint in xhr-example (#1782)
* use the new upload-endpoint in xhr example

* remove unused “bundle” example

* update dev Dashboard example with new xhr test endpoint
2019-08-20 18:01:36 +03:00
Renée Kooi
10bc79574e
lerna link convert (#1730)
* lerna link convert

* ci: use npm ci

* update lockfile

* companion: set `bin` to source file

Since typescript doesn't actually transform anything, we can just use
this.

In a next major version we could set `noEmit: true` in the tsconfig and
stop publishing `lib`.

* companion: do chmod +x on start-server.js

* build: remove obsolete lerna config

* build: explicitly install latest versions when building e2e tests for ci

* Remove versions from private packages

* fix regex

* try fix

* ci: force npm to install to endtoend folder

* ci: fold up e2e build output

* Update netlify deploy preview command

* Remove mentions of npm run bootstrap

* Edit .github/CONTRIBUTING.md instead

* companion: add proxy executable

* companion: fix publish

* Downgrade jest to appease create-react-app
2019-07-19 12:16:36 +02:00
Evgenia Karunus
0755798b8c Make DragDrop entirely clickable (#1633)
* /examples/dev - added drag-drop plugin dev environment

* @uppy/drag-drop - moved isDragDropSupported() to @uppy/utils

* @uppy/drag-drop - got rid of drag-drop npm library

* examples/dev - made compiled files placed in /output instead of /lib

* ~/examples/dev - made watchify only watch files once

* @uppy/drag-drop - add onPaste

* /examples/dev - readded html css override-attempts

* @uppy/drag-drop - made whole area clickable, and made it accessible

* @uppy/drag-drop - removed excessive outline in firefox

* change dragText classname to browse, minor spacing and order changes
2019-06-19 20:14:44 +03:00
Evgenia Karunus
7ce63fcb7e Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662)
* /examples/dev - added polyfills for easy development in IE11

* @uppy/dashboard - made all svgs not focusable in IE11

* /examples/dev - started sharing serviceWorker registration code

* /examples/dev - added polyfills for IE11 to dev bundle
2019-06-17 17:08:05 +03:00
Evgenia Karunus
8be2004826 Feature/replace dnd in drag drop package (#1565)
* /examples/dev - added drag-drop plugin dev environment

* @uppy/drag-drop - moved isDragDropSupported() to @uppy/utils

* @uppy/drag-drop - got rid of drag-drop npm library

* examples/dev - made compiled files placed in /output instead of /lib

* ~/examples/dev - made watchify only watch files once

* @uppy/drag-drop - add onPaste

* /examples/dev - readded html css override-attempts

* @uppy/drag-drop - made whole area clickable, and made it accessible

* @uppy/drag-drop - removed excessive outline in firefox

* REVERTED last 2 commits
2019-06-05 17:04:34 +03:00
Renée Kooi
065b1271dd
fix babel on dev example
have to set --cwd to make babelify transform files outside of the
current working directory.

in other examples, we use the lib/ files, so it's not necessary; here we
use the src/ files that need to be babelified still.
2019-05-20 11:49:36 +02:00
Renée Kooi
2574d1251c
Update babel in examples 2019-05-20 11:27:04 +02:00
Ifedapo Olarewaju
adeb2fecfa update docs, tests, and examples with companionUrl rename 2019-04-15 14:56:37 +01:00
Kevin van Zonneveld
5f4f1cf17e
Refactor npm scripts, clean up unused ones (#1392)
Co-Authored-By: Artur Paikin <artur@arturpaikin.com>
2019-03-29 14:55:23 +01:00
Artur Paikin
dfb6fe9bd7 add xhr-upload endpoint for dev testing 2019-03-29 15:58:03 +03:00
Artur Paikin
6a75cb05d9 dev example tweaks 2019-03-23 19:05:47 +03:00
Artur Paikin
81b6b275d4 add crazy styles on dev page to test uppy’s resistance ⚔️🤺 2019-03-11 17:07:47 +03:00
Artur Paikin
af115f3ace dev example: re-build lib automatically, don’t open browser and no ghosts, start companion 2019-02-06 22:07:10 +03:00