@uppy/dashboard
Advanced tools
Comparing version 1.12.0 to 1.12.1
@@ -100,23 +100,72 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } | ||
_this.renderDropPasteBrowseTagline = function () { | ||
var numberOfAcquirers = _this.props.acquirers.length; | ||
var numberOfAcquirers = _this.props.acquirers.length; // in order to keep the i18n CamelCase and options lower (as are defaults) we will want to transform a lower | ||
// to Camel | ||
var browseFiles = _this.renderBrowseButton(_this.props.i18n('browseFiles'), _this.triggerFileInputClick); | ||
var lowerFMSelectionType = _this.props.fileManagerSelectionType; | ||
var camelFMSelectionType = lowerFMSelectionType.charAt(0).toUpperCase() + lowerFMSelectionType.slice(1); // For backwards compatibility, we need to support both 'browse' and 'browseFiles'/'browseFolders' as strings here. | ||
var browseFolders = _this.renderBrowseButton(_this.props.i18n('browseFolders'), _this.triggerFolderInputClick); // in order to keep the i18n CamelCase and options lower (as are defaults) we will want to transform a lower | ||
// to Camel | ||
var browseText = 'browse'; | ||
var browseFilesText = 'browse'; | ||
var browseFoldersText = 'browse'; | ||
if (lowerFMSelectionType === 'files') { | ||
try { | ||
browseText = _this.props.i18n('browse'); | ||
browseFilesText = _this.props.i18n('browse'); | ||
browseFoldersText = _this.props.i18n('browse'); | ||
} catch (_unused) {// Ignore, hopefully we can use the 'browseFiles' / 'browseFolders' strings | ||
} | ||
} | ||
var lowerFMSelectionType = _this.props.fileManagerSelectionType; | ||
var camelFMSelectionType = lowerFMSelectionType.charAt(0).toUpperCase() + lowerFMSelectionType.slice(1); | ||
try { | ||
browseFilesText = _this.props.i18n('browseFiles'); | ||
browseFoldersText = _this.props.i18n('browseFolders'); | ||
} catch (_unused2) {// Ignore, use the 'browse' string | ||
} | ||
var browse = _this.renderBrowseButton(browseText, _this.triggerFileInputClick); | ||
var browseFiles = _this.renderBrowseButton(browseFilesText, _this.triggerFileInputClick); | ||
var browseFolders = _this.renderBrowseButton(browseFoldersText, _this.triggerFolderInputClick); // Before the `fileManagerSelectionType` feature existed, we had two possible | ||
// strings here, but now we have six. We use the new-style strings by default: | ||
var titleText; | ||
if (numberOfAcquirers > 0) { | ||
titleText = _this.props.i18nArray("dropPasteImport" + camelFMSelectionType, { | ||
browseFiles: browseFiles, | ||
browseFolders: browseFolders, | ||
browse: browse | ||
}); | ||
} else { | ||
titleText = _this.props.i18nArray("dropPasteImport" + camelFMSelectionType, { | ||
browseFiles: browseFiles, | ||
browseFolders: browseFolders, | ||
browse: browse | ||
}); | ||
} // We use the old-style strings if available: this implies that the user has | ||
// manually specified them, so they should take precedence over the new-style | ||
// defaults. | ||
if (lowerFMSelectionType === 'files') { | ||
try { | ||
if (numberOfAcquirers > 0) { | ||
titleText = _this.props.i18nArray('dropPaste', { | ||
browse: browse | ||
}); | ||
} else { | ||
titleText = _this.props.i18nArray('dropPasteImport', { | ||
browse: browse | ||
}); | ||
} | ||
} catch (_unused3) {// Ignore, the new-style strings will be used. | ||
} | ||
} | ||
return h("div", { | ||
class: "uppy-Dashboard-AddFiles-title" | ||
}, numberOfAcquirers > 0 ? _this.props.i18nArray("dropPasteImport" + camelFMSelectionType, { | ||
browseFiles: browseFiles, | ||
browseFolders: browseFolders, | ||
browse: browseFiles | ||
}) : _this.props.i18nArray("dropPaste" + camelFMSelectionType, { | ||
browseFiles: browseFiles, | ||
browseFolders: browseFolders, | ||
browse: browseFiles | ||
})); | ||
}, titleText); | ||
}; | ||
@@ -123,0 +172,0 @@ |
@@ -24,3 +24,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var PreactCSSTransitionGroup = require('preact8-css-transition-group'); // http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog | ||
var PreactCSSTransitionGroup = require('preact-css-transition-group'); // http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog | ||
// https://github.com/ghosh/micromodal | ||
@@ -27,0 +27,0 @@ |
@@ -1145,2 +1145,2 @@ var _class, _temp; | ||
return Dashboard; | ||
}(Plugin), _class.VERSION = "1.12.0", _temp); | ||
}(Plugin), _class.VERSION = "1.12.1", _temp); |
{ | ||
"name": "@uppy/dashboard", | ||
"description": "Universal UI plugin for Uppy.", | ||
"version": "1.12.0", | ||
"version": "1.12.1", | ||
"license": "MIT", | ||
@@ -26,7 +26,7 @@ "main": "lib/index.js", | ||
"@transloadit/prettier-bytes": "0.0.7", | ||
"@uppy/informer": "^1.5.8", | ||
"@uppy/provider-views": "^1.7.0", | ||
"@uppy/status-bar": "^1.7.1", | ||
"@uppy/thumbnail-generator": "^1.6.3", | ||
"@uppy/utils": "^3.2.0", | ||
"@uppy/informer": "^1.5.9", | ||
"@uppy/provider-views": "^1.7.1", | ||
"@uppy/status-bar": "^1.7.2", | ||
"@uppy/thumbnail-generator": "^1.6.4", | ||
"@uppy/utils": "^3.2.1", | ||
"classnames": "^2.2.6", | ||
@@ -39,3 +39,3 @@ "cuid": "^2.1.1", | ||
"preact": "8.2.9", | ||
"preact8-css-transition-group": "^2.1.0", | ||
"preact-css-transition-group": "^1.3.0", | ||
"resize-observer-polyfill": "^1.5.0" | ||
@@ -46,3 +46,3 @@ }, | ||
}, | ||
"gitHead": "6151b337004204137893c9fc52bfab139acca652" | ||
"gitHead": "2d91641ddd1efbb7b21ba850156d865491999106" | ||
} |
@@ -27,3 +27,3 @@ # @uppy/dashboard | ||
const uppy = Uppy() | ||
const uppy = new Uppy() | ||
uppy.use(Dashboard, { | ||
@@ -30,0 +30,0 @@ target: 'body', |
@@ -112,7 +112,5 @@ const { h, Component } = require('preact') | ||
// TODO(2.x) remove all the backwards compatibility garbage here | ||
renderDropPasteBrowseTagline = () => { | ||
const numberOfAcquirers = this.props.acquirers.length | ||
const browseFiles = this.renderBrowseButton(this.props.i18n('browseFiles'), this.triggerFileInputClick) | ||
const browseFolders = this.renderBrowseButton(this.props.i18n('browseFolders'), this.triggerFolderInputClick) | ||
// in order to keep the i18n CamelCase and options lower (as are defaults) we will want to transform a lower | ||
@@ -123,9 +121,53 @@ // to Camel | ||
// For backwards compatibility, we need to support both 'browse' and 'browseFiles'/'browseFolders' as strings here. | ||
let browseText = 'browse' | ||
let browseFilesText = 'browse' | ||
let browseFoldersText = 'browse' | ||
if (lowerFMSelectionType === 'files') { | ||
try { | ||
browseText = this.props.i18n('browse') | ||
browseFilesText = this.props.i18n('browse') | ||
browseFoldersText = this.props.i18n('browse') | ||
} catch { | ||
// Ignore, hopefully we can use the 'browseFiles' / 'browseFolders' strings | ||
} | ||
} | ||
try { | ||
browseFilesText = this.props.i18n('browseFiles') | ||
browseFoldersText = this.props.i18n('browseFolders') | ||
} catch { | ||
// Ignore, use the 'browse' string | ||
} | ||
const browse = this.renderBrowseButton(browseText, this.triggerFileInputClick) | ||
const browseFiles = this.renderBrowseButton(browseFilesText, this.triggerFileInputClick) | ||
const browseFolders = this.renderBrowseButton(browseFoldersText, this.triggerFolderInputClick) | ||
// Before the `fileManagerSelectionType` feature existed, we had two possible | ||
// strings here, but now we have six. We use the new-style strings by default: | ||
let titleText | ||
if (numberOfAcquirers > 0) { | ||
titleText = this.props.i18nArray(`dropPasteImport${camelFMSelectionType}`, { browseFiles, browseFolders, browse }) | ||
} else { | ||
titleText = this.props.i18nArray(`dropPasteImport${camelFMSelectionType}`, { browseFiles, browseFolders, browse }) | ||
} | ||
// We use the old-style strings if available: this implies that the user has | ||
// manually specified them, so they should take precedence over the new-style | ||
// defaults. | ||
if (lowerFMSelectionType === 'files') { | ||
try { | ||
if (numberOfAcquirers > 0) { | ||
titleText = this.props.i18nArray('dropPaste', { browse }) | ||
} else { | ||
titleText = this.props.i18nArray('dropPasteImport', { browse }) | ||
} | ||
} catch { | ||
// Ignore, the new-style strings will be used. | ||
} | ||
} | ||
return ( | ||
<div class="uppy-Dashboard-AddFiles-title"> | ||
{ | ||
numberOfAcquirers > 0 | ||
? this.props.i18nArray(`dropPasteImport${camelFMSelectionType}`, { browseFiles, browseFolders, browse: browseFiles }) | ||
: this.props.i18nArray(`dropPaste${camelFMSelectionType}`, { browseFiles, browseFolders, browse: browseFiles }) | ||
} | ||
{titleText} | ||
</div> | ||
@@ -132,0 +174,0 @@ ) |
@@ -11,3 +11,3 @@ const FileList = require('./FileList') | ||
const { h } = require('preact') | ||
const PreactCSSTransitionGroup = require('preact8-css-transition-group') | ||
const PreactCSSTransitionGroup = require('preact-css-transition-group') | ||
@@ -14,0 +14,0 @@ // http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
571613
7585
+ Addedpreact-css-transition-group@1.3.0(transitive)
- Removedpreact8-css-transition-group@^2.1.0
- Removedpreact8-css-transition-group@2.1.1(transitive)
Updated@uppy/informer@^1.5.9
Updated@uppy/provider-views@^1.7.1
Updated@uppy/status-bar@^1.7.2
Updated@uppy/utils@^3.2.1