@uppy/informer
Advanced tools
Comparing version 2.1.0 to 3.0.0-beta
@@ -1,11 +0,7 @@ | ||
"use strict"; | ||
var _preact = require("preact"); | ||
import { h, Component, createRef } from 'preact'; | ||
const TRANSITION_MS = 300; | ||
class FadeIn extends _preact.Component { | ||
export default class FadeIn extends Component { | ||
constructor() { | ||
super(...arguments); | ||
this.ref = (0, _preact.createRef)(); | ||
this.ref = createRef(); | ||
} | ||
@@ -29,3 +25,3 @@ | ||
} = this.props; | ||
return (0, _preact.h)("div", { | ||
return h("div", { | ||
className: "uppy-Informer-animated", | ||
@@ -36,4 +32,2 @@ ref: this.ref | ||
} | ||
module.exports = FadeIn; | ||
} |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
module.exports = require("./Informer.js"); | ||
export { default } from "./Informer.js"; |
@@ -1,16 +0,10 @@ | ||
"use strict"; | ||
var _preact = require("preact"); | ||
var _core = require("@uppy/core"); | ||
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ | ||
/* eslint-disable jsx-a11y/click-events-have-key-events */ | ||
const FadeIn = require("./FadeIn.js"); | ||
const TransitionGroup = require("./TransitionGroup.js"); | ||
import { h } from 'preact'; | ||
import { UIPlugin } from '@uppy/core'; | ||
import FadeIn from "./FadeIn.js"; | ||
import TransitionGroup from './TransitionGroup.js'; | ||
const packageJson = { | ||
"version": "2.1.0" | ||
"version": "3.0.0-beta" | ||
}; | ||
@@ -25,3 +19,3 @@ /** | ||
class Informer extends _core.UIPlugin { | ||
export default class Informer extends UIPlugin { | ||
constructor(uppy, opts) { | ||
@@ -31,9 +25,9 @@ super(uppy, opts); | ||
this.render = state => { | ||
return (0, _preact.h)("div", { | ||
return h("div", { | ||
className: "uppy uppy-Informer" | ||
}, (0, _preact.h)(TransitionGroup, null, state.info.map(info => (0, _preact.h)(FadeIn, { | ||
}, h(TransitionGroup, null, state.info.map(info => h(FadeIn, { | ||
key: info.message | ||
}, (0, _preact.h)("p", { | ||
}, h("p", { | ||
role: "alert" | ||
}, info.message, ' ', info.details && (0, _preact.h)("span", { | ||
}, info.message, ' ', info.details && h("span", { | ||
"aria-label": info.details, | ||
@@ -70,4 +64,2 @@ "data-microtip-position": "top-left", | ||
} | ||
Informer.VERSION = packageJson.version; | ||
module.exports = Informer; | ||
Informer.VERSION = packageJson.version; |
@@ -1,5 +0,1 @@ | ||
"use strict"; | ||
var _preact = require("preact"); | ||
/* eslint-disable */ | ||
@@ -10,2 +6,4 @@ | ||
*/ | ||
import { Component, cloneElement, h, toChildArray } from 'preact'; | ||
function assign(obj, props) { | ||
@@ -86,3 +84,3 @@ return Object.assign(obj, props); | ||
class TransitionGroup extends _preact.Component { | ||
class TransitionGroup extends Component { | ||
constructor(props, context) { | ||
@@ -92,3 +90,3 @@ super(props, context); | ||
this.state = { | ||
children: getChildMapping((0, _preact.toChildArray)((0, _preact.toChildArray)(this.props.children)) || []) | ||
children: getChildMapping(toChildArray(toChildArray(this.props.children)) || []) | ||
}; | ||
@@ -119,3 +117,3 @@ this.performAppear = this.performAppear.bind(this); | ||
componentWillReceiveProps(nextProps) { | ||
const nextChildMapping = getChildMapping((0, _preact.toChildArray)(nextProps.children) || []); | ||
const nextChildMapping = getChildMapping(toChildArray(nextProps.children) || []); | ||
const prevChildMapping = this.state.children; | ||
@@ -194,3 +192,3 @@ this.setState(prevState => ({ | ||
const currentChildMapping = getChildMapping((0, _preact.toChildArray)(this.props.children) || []); | ||
const currentChildMapping = getChildMapping(toChildArray(this.props.children) || []); | ||
@@ -225,3 +223,3 @@ if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) { | ||
const currentChildMapping = getChildMapping((0, _preact.toChildArray)(this.props.children) || []); | ||
const currentChildMapping = getChildMapping(toChildArray(this.props.children) || []); | ||
@@ -272,3 +270,3 @@ if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) { | ||
delete this.currentlyTransitioningKeys[key]; | ||
const currentChildMapping = getChildMapping((0, _preact.toChildArray)(this.props.children) || []); | ||
const currentChildMapping = getChildMapping(toChildArray(this.props.children) || []); | ||
@@ -313,3 +311,3 @@ if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) { | ||
const ref = linkRef(this, key), | ||
el = (0, _preact.cloneElement)(childFactory(child), { | ||
el = cloneElement(childFactory(child), { | ||
ref, | ||
@@ -323,3 +321,3 @@ key | ||
return (0, _preact.h)(component, props, childrenToRender); | ||
return h(component, props, childrenToRender); | ||
} | ||
@@ -333,2 +331,2 @@ | ||
}; | ||
module.exports = TransitionGroup; | ||
export default TransitionGroup; |
{ | ||
"name": "@uppy/informer", | ||
"description": "A notification and error pop-up bar for Uppy.", | ||
"version": "2.1.0", | ||
"version": "3.0.0-beta", | ||
"license": "MIT", | ||
@@ -27,8 +27,9 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/utils": "^4.1.0", | ||
"@uppy/utils": "^5.0.0-beta", | ||
"preact": "^10.5.13" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^2.3.0" | ||
} | ||
"@uppy/core": "^3.0.0-beta" | ||
}, | ||
"stableVersion": "2.1.0" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
53282
21
734
1
+ Added@transloadit/prettier-bytes@0.3.4(transitive)
+ Added@uppy/core@3.13.1(transitive)
+ Added@uppy/store-default@3.2.2(transitive)
+ Added@uppy/utils@5.9.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addednanoid@4.0.2(transitive)
- Removed@transloadit/prettier-bytes@0.0.7(transitive)
- Removed@uppy/core@2.3.4(transitive)
- Removed@uppy/store-default@2.1.1(transitive)
- Removed@uppy/utils@4.1.3(transitive)
- Removedlodash.throttle@4.1.1(transitive)
- Removednanoid@3.3.7(transitive)
Updated@uppy/utils@^5.0.0-beta