@uppy/informer
Advanced tools
Comparing version 1.3.4 to 1.4.0
@@ -5,4 +5,2 @@ var _class, _temp; | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } | ||
@@ -33,2 +31,38 @@ | ||
_this = _Plugin.call(this, uppy, opts) || this; | ||
_this.render = function (state) { | ||
var _state$info = state.info, | ||
isHidden = _state$info.isHidden, | ||
message = _state$info.message, | ||
details = _state$info.details; | ||
function displayErrorAlert() { | ||
var errorMessage = message + " \n\n " + details; | ||
alert(errorMessage); | ||
} | ||
var handleMouseOver = function handleMouseOver() { | ||
clearTimeout(_this.uppy.infoTimeoutID); | ||
}; | ||
var handleMouseLeave = function handleMouseLeave() { | ||
_this.uppy.infoTimeoutID = setTimeout(_this.uppy.hideInfo, 2000); | ||
}; | ||
return h("div", { | ||
class: "uppy uppy-Informer", | ||
"aria-hidden": isHidden | ||
}, h("p", { | ||
role: "alert" | ||
}, message, ' ', details && h("span", { | ||
"aria-label": details, | ||
"data-microtip-position": "top-left", | ||
"data-microtip-size": "medium", | ||
role: "tooltip", | ||
onclick: displayErrorAlert, | ||
onMouseOver: handleMouseOver, | ||
onMouseLeave: handleMouseLeave | ||
}, "?"))); | ||
}; | ||
_this.type = 'progressindicator'; | ||
@@ -41,3 +75,2 @@ _this.id = _this.opts.id || 'Informer'; | ||
_this.opts = _extends({}, defaultOptions, opts); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
return _this; | ||
@@ -48,20 +81,2 @@ } | ||
_proto.render = function render(state) { | ||
var _state$info = state.info, | ||
isHidden = _state$info.isHidden, | ||
message = _state$info.message, | ||
details = _state$info.details; | ||
return h("div", { | ||
class: "uppy uppy-Informer", | ||
"aria-hidden": isHidden | ||
}, h("p", { | ||
role: "alert" | ||
}, message, ' ', details && h("span", { | ||
"aria-label": details, | ||
"data-microtip-position": "top-left", | ||
"data-microtip-size": "medium", | ||
role: "tooltip" | ||
}, "?"))); | ||
}; | ||
_proto.install = function install() { | ||
@@ -76,2 +91,2 @@ var target = this.opts.target; | ||
return Informer; | ||
}(Plugin), _class.VERSION = "1.3.4", _temp); | ||
}(Plugin), _class.VERSION = "1.4.0", _temp); |
{ | ||
"name": "@uppy/informer", | ||
"description": "A notification and error pop-up bar for Uppy.", | ||
"version": "1.3.4", | ||
"version": "1.4.0", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/utils": "^2.1.2", | ||
"@uppy/utils": "file:../utils", | ||
"preact": "8.2.9" | ||
@@ -32,4 +32,3 @@ }, | ||
"@uppy/core": "^1.0.0" | ||
}, | ||
"gitHead": "2b91a96c95ea1aa32980984904f9877d8a4c4440" | ||
} | ||
} |
@@ -22,12 +22,22 @@ const { Plugin } = require('@uppy/core') | ||
const defaultOptions = {} | ||
// merge default options with the ones set by user | ||
this.opts = Object.assign({}, defaultOptions, opts) | ||
this.render = this.render.bind(this) | ||
} | ||
render (state) { | ||
render = (state) => { | ||
const { isHidden, message, details } = state.info | ||
function displayErrorAlert () { | ||
const errorMessage = `${message} \n\n ${details}` | ||
alert(errorMessage) | ||
} | ||
const handleMouseOver = () => { | ||
clearTimeout(this.uppy.infoTimeoutID) | ||
} | ||
const handleMouseLeave = () => { | ||
this.uppy.infoTimeoutID = setTimeout(this.uppy.hideInfo, 2000) | ||
} | ||
return ( | ||
@@ -47,2 +57,5 @@ <div | ||
role="tooltip" | ||
onclick={displayErrorAlert} | ||
onMouseOver={handleMouseOver} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
@@ -49,0 +62,0 @@ ? |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
11843
205
1
- Removed@uppy/utils@2.4.4(transitive)
Updated@uppy/utils@file:../utils