* use cors module instead of custom cors logic #2762
- adds support for regex COMPANION_CLIENT_ORIGINS_REGEX
- encapsulate custom cors header merge logic in own middleware
- pull out non cors logic from middleware
- unit test the cors middleware
* fix capitalization
Co-authored-by: Julian Gruber <julian@juliangruber.com>
Co-authored-by: Julian Gruber <julian@juliangruber.com>
I thought of this as a server-side issue when initially writing it, but
if you don't have S3 uploads configured, users can still target the
endpoint. So that endpoint should never crash the process.
With this change users get a 400 response when trying to start an S3 upload
of remote files if their Companion server does not support it.
So folks can use it more easily in their server-side typescript projects.
We don't have precise types for the `options` objects yet. We should add
that too.
* move findIndex to @uppy/utils, add tests
* use Array.findIndex instead of Array.indexOf in uppy.removePlugin
because strict comparison started failing with Vue3 Proxies
* Introduce opts.disabled for the Dashboard
* Reduce opacity, disable user-select, set cursor
* Add classes to providers' background circles
So they can be grayscaled via css
* add disableAllFocusableElements and run it in afterUpdate hook, if needed
* increase opacity for readability
* Store previous tabindex value and use it when restoring (setting disable: false)
//cc @goto-bus-stop
* Add disabled docs
* add disabled option to website example
Co-authored-by: Alexander Zaytsev <nqst@users.noreply.github.com>
The DOM changed to accomodate RTL scripts, but this CSS rule was not
changed accordingly.
The StatusBar does not know its own width, so a standalone StatusBar
would never have an `.uppy-size--md` parent element. You only get that
with the Dashboard. So I've moved the rule to the Dashboard plugin, and
the selector now checks for `.uppy-Dashboard`. That element also has the
size classes.
The standalone StatusBar does not auto-hide progress details on narrow
screens. I think that's probably fine, if you're using it directly and
explicitly asking for progress details you might want to always see
them…
With this patch you can do
```js
uppy.use(XHRUpload, {
headers: file => ({
'authorization': `bearer ${global.userToken}`,
'header-name': file.meta.someMetaValue
})
})
```
to determine file-specific headers.
The function syntax for `headers` is only available if the `bundle`
option is `false` (the default). `bundle` uploads only use one set of
headers.
I assumed `Expires` had to do with signed URL expiration, but in the
case of `createMultipartUpload`, it affects the _uploaded file itself_.
Those files are not automatically removed but no longer cacheable after
the expiration time, which is still bad.
Thanks to @Dock1100 for raising this! Fixes#2483.
* dashboard: fix modal position on rtl pages, fixes#2495
* Align text to the right on right-to-left pages
* core: fix default text alignment on right-to-left pages
* dashboard: fix margin in provider browser on right-to-left pages
* dashboard: use direction-aware offset properties
* provider-views: use logical offset CSS properties
* status-bar: use logical offset CSS properties
* dashboard: fix addMore icon margin on RTL pages
* dashboard: some more logical properties
* build: compile logical properties to old CSS
* dashboard: set dir attribute if page did not provide one
* status-bar: set fallback text direction if not provided
* support direction option for inline and modal dashboard
* use companion.uppy.io on deploy previews
* provider-views: fix RTL alignment of file icons
* put the dir attribute on a wrapper div
* fix icon alignment in RTL provider views
* informer: fix ? alignment in RTL mode
* Add all the CI badges
* flip the CI / npm version order
* add github actions tests badges to all package readmes
* remove |
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
* companion-client: support options cookies send rule
fixes#2241
* companion-client: prefix cookiesSendRule option with "companion"
* companion-client: set "companionCookiesRule" as optional field