Socket
Socket
Sign inDemoInstall

@uppy/status-bar

Package Overview
Dependencies
12
Maintainers
8
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.1 to 3.0.0-beta

33

lib/_StatusBar.js

@@ -1,22 +0,13 @@

"use strict";
var _core = require("@uppy/core");
// TODO: rename this file to StatusBar.jsx on the next major.
const getSpeed = require("@uppy/utils/lib/getSpeed");
const getBytesRemaining = require("@uppy/utils/lib/getBytesRemaining");
const getTextDirection = require("@uppy/utils/lib/getTextDirection");
const statusBarStates = require("./StatusBarStates.js");
const StatusBarUI = require("./StatusBar.js");
import { UIPlugin } from '@uppy/core';
import getSpeed from '@uppy/utils/lib/getSpeed';
import getBytesRemaining from '@uppy/utils/lib/getBytesRemaining';
import getTextDirection from '@uppy/utils/lib/getTextDirection';
import statusBarStates from './StatusBarStates.js';
import StatusBarUI from "./StatusBar.js";
const packageJson = {
"version": "2.2.1"
"version": "3.0.0-beta"
};
import locale from './locale.js';
const locale = require("./locale.js");
function getTotalSpeed(files) {

@@ -89,3 +80,3 @@ let totalSpeed = 0;

class StatusBar extends _core.UIPlugin {
export default class StatusBar extends UIPlugin {
constructor(uppy, opts) {

@@ -111,3 +102,3 @@ super(uppy, opts);

this.type = 'progressindicator';
this.defaultLocale = locale; // set default options
this.defaultLocale = locale; // set default options, must be kept in sync with @uppy/react/src/StatusBar.js

@@ -226,4 +217,2 @@ const defaultOptions = {

}
StatusBar.VERSION = packageJson.version;
module.exports = StatusBar;
StatusBar.VERSION = packageJson.version;

@@ -1,4 +0,2 @@

"use strict";
function calculateProcessingProgress(files) {
export default function calculateProcessingProgress(files) {
const values = [];

@@ -36,4 +34,2 @@ let mode;

};
}
module.exports = calculateProcessingProgress;
}

@@ -1,30 +0,7 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CancelBtn = CancelBtn;
exports.DoneBtn = DoneBtn;
exports.LoadingSpinner = LoadingSpinner;
exports.PauseResumeButton = PauseResumeButton;
exports.ProgressBarComplete = ProgressBarComplete;
exports.ProgressBarError = ProgressBarError;
exports.ProgressBarProcessing = ProgressBarProcessing;
exports.ProgressBarUploading = ProgressBarUploading;
exports.ProgressDetails = ProgressDetails;
exports.RetryBtn = RetryBtn;
exports.UploadBtn = UploadBtn;
var _preact = require("preact");
const classNames = require("classnames");
const throttle = require("lodash.throttle");
const prettierBytes = require("@transloadit/prettier-bytes");
const prettyETA = require("@uppy/utils/lib/prettyETA");
const statusBarStates = require("./StatusBarStates.js");
import { h } from 'preact';
import classNames from 'classnames';
import throttle from 'lodash.throttle';
import prettierBytes from '@transloadit/prettier-bytes';
import prettyETA from '@uppy/utils/lib/prettyETA';
import statusBarStates from './StatusBarStates.js';
const DOT = `\u00B7`;

@@ -54,3 +31,3 @@

});
return (0, _preact.h)("button", {
return h("button", {
type: "button",

@@ -72,3 +49,3 @@ className: uploadBtnClassNames,

} = props;
return (0, _preact.h)("button", {
return h("button", {
type: "button",

@@ -79,3 +56,3 @@ className: "uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry",

"data-uppy-super-focusable": true
}, (0, _preact.h)("svg", {
}, h("svg", {
"aria-hidden": "true",

@@ -87,3 +64,3 @@ focusable: "false",

viewBox: "0 0 8 10"
}, (0, _preact.h)("path", {
}, h("path", {
d: "M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"

@@ -98,3 +75,3 @@ })), i18n('retry'));

} = props;
return (0, _preact.h)("button", {
return h("button", {
type: "button",

@@ -107,3 +84,3 @@ className: "uppy-u-reset uppy-StatusBar-actionCircleBtn",

"data-uppy-super-focusable": true
}, (0, _preact.h)("svg", {
}, h("svg", {
"aria-hidden": "true",

@@ -115,6 +92,6 @@ focusable: "false",

viewBox: "0 0 16 16"
}, (0, _preact.h)("g", {
}, h("g", {
fill: "none",
fillRule: "evenodd"
}, (0, _preact.h)("circle", {
}, h("circle", {
fill: "#888",

@@ -124,3 +101,3 @@ cx: "8",

r: "8"
}), (0, _preact.h)("path", {
}), h("path", {
fill: "#FFF",

@@ -155,3 +132,3 @@ d: "M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"

return (0, _preact.h)("button", {
return h("button", {
title: title,

@@ -163,3 +140,3 @@ "aria-label": title,

"data-uppy-super-focusable": true
}, (0, _preact.h)("svg", {
}, h("svg", {
"aria-hidden": "true",

@@ -171,6 +148,6 @@ focusable: "false",

viewBox: "0 0 16 16"
}, (0, _preact.h)("g", {
}, h("g", {
fill: "none",
fillRule: "evenodd"
}, (0, _preact.h)("circle", {
}, h("circle", {
fill: "#888",

@@ -180,3 +157,3 @@ cx: "8",

r: "8"
}), (0, _preact.h)("path", {
}), h("path", {
fill: "#FFF",

@@ -192,3 +169,3 @@ d: isAllPaused ? 'M6 4.25L11.5 8 6 11.75z' : 'M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z'

} = props;
return (0, _preact.h)("button", {
return h("button", {
type: "button",

@@ -202,3 +179,3 @@ className: "uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",

function LoadingSpinner() {
return (0, _preact.h)("svg", {
return h("svg", {
className: "uppy-StatusBar-spinner",

@@ -209,3 +186,3 @@ "aria-hidden": "true",

height: "14"
}, (0, _preact.h)("path", {
}, h("path", {
d: "M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",

@@ -227,5 +204,5 @@ fillRule: "evenodd"

const dot = `\u00B7`;
return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-content"
}, (0, _preact.h)(LoadingSpinner, null), mode === 'determinate' ? `${roundedValue}% ${dot} ` : '', message);
}, h(LoadingSpinner, null), mode === 'determinate' ? `${roundedValue}% ${dot} ` : '', message);
}

@@ -243,3 +220,3 @@

const ifShowFilesUploadedOfTotal = numUploads > 1;
return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-statusSecondary"

@@ -249,3 +226,3 @@ }, ifShowFilesUploadedOfTotal && i18n('filesUploadedOfTotal', {

smart_count: numUploads
}), (0, _preact.h)("span", {
}), h("span", {
className: "uppy-StatusBar-additionalInfo"

@@ -266,3 +243,3 @@ }, ifShowFilesUploadedOfTotal && renderDot(), i18n('dataUploadedOfTotal', {

} = props;
return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-statusSecondary"

@@ -282,9 +259,9 @@ }, i18n('filesUploadedOfTotal', {

const uploadBtnClassNames = classNames('uppy-u-reset', 'uppy-c-btn', 'uppy-StatusBar-actionBtn', 'uppy-StatusBar-actionBtn--uploadNewlyAdded');
return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-statusSecondary"
}, (0, _preact.h)("div", {
}, h("div", {
className: "uppy-StatusBar-statusSecondaryHint"
}, i18n('xMoreFilesAdded', {
smart_count: newFiles
})), (0, _preact.h)("button", {
})), h("button", {
type: "button",

@@ -332,3 +309,3 @@ className: uploadBtnClassNames,

if (supportsUploadProgress) {
return (0, _preact.h)(ThrottledProgressDetails, {
return h(ThrottledProgressDetails, {
numUploads: numUploads,

@@ -343,3 +320,3 @@ complete: complete,

return (0, _preact.h)(FileUploadCount, {
return h(FileUploadCount, {
i18n: i18n,

@@ -354,11 +331,11 @@ complete: complete,

return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-content",
"aria-label": title,
title: title
}, !isAllPaused ? (0, _preact.h)(LoadingSpinner, null) : null, (0, _preact.h)("div", {
}, !isAllPaused ? h(LoadingSpinner, null) : null, h("div", {
className: "uppy-StatusBar-status"
}, (0, _preact.h)("div", {
}, h("div", {
className: "uppy-StatusBar-statusPrimary"
}, supportsUploadProgress ? `${title}: ${totalProgress}%` : title), renderProgressDetails(), showUploadNewlyAddedFiles ? (0, _preact.h)(UploadNewlyAddedFiles, {
}, supportsUploadProgress ? `${title}: ${totalProgress}%` : title), renderProgressDetails(), showUploadNewlyAddedFiles ? h(UploadNewlyAddedFiles, {
i18n: i18n,

@@ -374,11 +351,11 @@ newFiles: newFiles,

} = props;
return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-content",
role: "status",
title: i18n('complete')
}, (0, _preact.h)("div", {
}, h("div", {
className: "uppy-StatusBar-status"
}, (0, _preact.h)("div", {
}, h("div", {
className: "uppy-StatusBar-statusPrimary"
}, (0, _preact.h)("svg", {
}, h("svg", {
"aria-hidden": "true",

@@ -390,3 +367,3 @@ focusable: "false",

viewBox: "0 0 15 11"
}, (0, _preact.h)("path", {
}, h("path", {
d: "M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"

@@ -410,6 +387,6 @@ })), i18n('complete'))));

return (0, _preact.h)("div", {
return h("div", {
className: "uppy-StatusBar-content",
title: i18n('uploadFailed')
}, (0, _preact.h)("svg", {
}, h("svg", {
"aria-hidden": "true",

@@ -421,9 +398,9 @@ focusable: "false",

viewBox: "0 0 11 11"
}, (0, _preact.h)("path", {
}, h("path", {
d: "M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"
})), (0, _preact.h)("div", {
})), h("div", {
className: "uppy-StatusBar-status"
}, (0, _preact.h)("div", {
}, h("div", {
className: "uppy-StatusBar-statusPrimary"
}, i18n('uploadFailed'), (0, _preact.h)("button", {
}, i18n('uploadFailed'), h("button", {
className: "uppy-u-reset uppy-StatusBar-details",

@@ -435,3 +412,3 @@ "aria-label": i18n('showErrorDetails'),

type: "button"
}, "?")), (0, _preact.h)(FileUploadCount, {
}, "?")), h(FileUploadCount, {
i18n: i18n,

@@ -441,2 +418,4 @@ complete: complete,

})));
}
}
export { UploadBtn, RetryBtn, CancelBtn, PauseResumeButton, DoneBtn, LoadingSpinner, ProgressDetails, ProgressBarProcessing, ProgressBarError, ProgressBarUploading, ProgressBarComplete };

@@ -1,3 +0,1 @@

"use strict";
module.exports = require("./_StatusBar.js");
export { default } from "./_StatusBar.js";

@@ -1,4 +0,2 @@

"use strict";
module.exports = {
export default {
strings: {

@@ -5,0 +3,0 @@ // Shown in the status bar while files are being uploaded.

@@ -1,14 +0,7 @@

"use strict";
var _preact = require("preact");
var _Components = require("./Components.js");
// TODO: rename this file to StatusBarUI>jsx on the next major.
const classNames = require("classnames");
const statusBarStates = require("./StatusBarStates.js");
const calculateProcessingProgress = require("./calculateProcessingProgress.js");
import { h } from 'preact';
import classNames from 'classnames';
import statusBarStates from './StatusBarStates.js';
import calculateProcessingProgress from './calculateProcessingProgress.js';
import { UploadBtn, RetryBtn, CancelBtn, PauseResumeButton, DoneBtn, ProgressBarProcessing, ProgressBarError, ProgressBarUploading, ProgressBarComplete } from "./Components.js";
const {

@@ -23,3 +16,3 @@ STATE_ERROR,

function StatusBar(props) {
export default function StatusBar(props) {
const {

@@ -146,6 +139,6 @@ newFiles,

});
return (0, _preact.h)("div", {
return h("div", {
className: statusBarClassNames,
"aria-hidden": isHidden
}, (0, _preact.h)("div", {
}, h("div", {
className: progressClassNames,

@@ -165,3 +158,3 @@ style: {

case STATE_POSTPROCESSING:
return (0, _preact.h)(_Components.ProgressBarProcessing, {
return h(ProgressBarProcessing, {
progress: calculateProcessingProgress(files)

@@ -171,3 +164,3 @@ });

case STATE_COMPLETE:
return (0, _preact.h)(_Components.ProgressBarComplete, {
return h(ProgressBarComplete, {
i18n: i18n

@@ -177,3 +170,3 @@ });

case STATE_ERROR:
return (0, _preact.h)(_Components.ProgressBarError, {
return h(ProgressBarError, {
error: error,

@@ -186,3 +179,3 @@ i18n: i18n,

case STATE_UPLOADING:
return (0, _preact.h)(_Components.ProgressBarUploading, {
return h(ProgressBarUploading, {
i18n: i18n,

@@ -207,5 +200,5 @@ supportsUploadProgress: supportsUploadProgress,

}
})(), (0, _preact.h)("div", {
})(), h("div", {
className: "uppy-StatusBar-actions"
}, recoveredState || showUploadBtn ? (0, _preact.h)(_Components.UploadBtn, {
}, recoveredState || showUploadBtn ? h(UploadBtn, {
newFiles: newFiles,

@@ -218,6 +211,6 @@ isUploadStarted: isUploadStarted,

uploadState: uploadState
}) : null, showRetryBtn ? (0, _preact.h)(_Components.RetryBtn, {
}) : null, showRetryBtn ? h(RetryBtn, {
i18n: i18n,
uppy: uppy
}) : null, showPauseResumeBtn ? (0, _preact.h)(_Components.PauseResumeButton, {
}) : null, showPauseResumeBtn ? h(PauseResumeButton, {
isAllPaused: isAllPaused,

@@ -228,11 +221,9 @@ i18n: i18n,

uppy: uppy
}) : null, showCancelBtn ? (0, _preact.h)(_Components.CancelBtn, {
}) : null, showCancelBtn ? h(CancelBtn, {
i18n: i18n,
uppy: uppy
}) : null, showDoneBtn ? (0, _preact.h)(_Components.DoneBtn, {
}) : null, showDoneBtn ? h(DoneBtn, {
i18n: i18n,
doneButtonHandler: doneButtonHandler
}) : null));
}
module.exports = StatusBar;
}

@@ -1,4 +0,2 @@

"use strict";
module.exports = {
export default {
STATE_ERROR: 'error',

@@ -5,0 +3,0 @@ STATE_WAITING: 'waiting',

{
"name": "@uppy/status-bar",
"description": "A progress bar for Uppy, with many bells and whistles.",
"version": "2.2.1",
"version": "3.0.0-beta",
"license": "MIT",

@@ -31,3 +31,3 @@ "main": "lib/index.js",

"@transloadit/prettier-bytes": "0.0.7",
"@uppy/utils": "^4.1.0",
"@uppy/utils": "^5.0.0-beta",
"classnames": "^2.2.6",

@@ -38,4 +38,5 @@ "lodash.throttle": "^4.1.1",

"peerDependencies": {
"@uppy/core": "^2.3.0"
}
"@uppy/core": "^3.0.0-beta"
},
"stableVersion": "2.2.1"
}

@@ -88,3 +88,3 @@ // TODO: rename this file to StatusBar.jsx on the next major.

// set default options
// set default options, must be kept in sync with @uppy/react/src/StatusBar.js
const defaultOptions = {

@@ -91,0 +91,0 @@ target: 'body',

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc