diff --git a/.babelrc b/.babelrc index eb7e68e..22c053b 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["es2015", "react"], + "presets": ["es2015", "react", "stage-0"], "plugins": [ "transform-es2015-duplicate-keys", "transform-class-properties" diff --git a/CHANGELOG.md b/CHANGELOG.md index de3084c..640888a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,9 @@ ## v0.0.2 **What's New?** +* Docs updated with useful information +* Updated some modules to the latest version +* personalised notification enabled +* breaking change avatar is now passed as url image instead of element +* overflowText is now string +* minWidth of the container changed to 325px as default diff --git a/README.md b/README.md index 60b2283..6693788 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Spec compliant notifications for react and material ui users * Use the latest github release * or Install via `npm i react-materialui-notifications` +# Demo + +For a demo see the docs site (below), for usage example see `src/app/Main.js` + # Documentation Consult the website [https://puranjayjain.github.io/react-materialui-notifications](https://puranjayjain.github.io/react-materialui-notifications) @@ -24,7 +28,10 @@ but we'll adhere to those rules whenever possible. # TODO - [x] a lot of core functionality -- [ ] finish up props of the notification class +- [x] finish up props of the notification class +- [ ] implement expanding notifications +- [x] show the priority notifications on top +- [ ] implement custom notification element which the user can pass (PR required) - [x] styles for position - [ ] swipe to dismiss - [ ] i18n diff --git a/assets/demo.png b/assets/demo.png new file mode 100644 index 0000000..6dc9daf Binary files /dev/null and b/assets/demo.png differ diff --git a/build/ReactMaterialUiNotifications.js b/build/ReactMaterialUiNotifications.js index dea03c4..9fe7179 100644 --- a/build/ReactMaterialUiNotifications.js +++ b/build/ReactMaterialUiNotifications.js @@ -43,7 +43,7 @@ var CSSCore = { * @return {DOMElement} the element passed in */ addClass: function addClass(element, className) { - !!/\s/.test(className) ? "production" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; + !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; if (className) { if (element.classList) { @@ -63,7 +63,7 @@ var CSSCore = { * @return {DOMElement} the element passed in */ removeClass: function removeClass(element, className) { - !!/\s/.test(className) ? "production" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; + !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0; if (className) { if (element.classList) { @@ -96,7 +96,7 @@ var CSSCore = { * @return {boolean} true if the element has the class, false if not */ hasClass: function hasClass(element, className) { - !!/\s/.test(className) ? "production" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0; + !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0; if (element.classList) { return !!className && element.classList.contains(className); } @@ -191,7 +191,7 @@ var EventListener = { } }; } else { - if ("production" !== 'production') { + if ("development" !== 'production') { console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); } return { @@ -382,13 +382,13 @@ function toArray(obj) { // Some browsers builtin objects can report typeof 'function' (e.g. NodeList // in old versions of Safari). - !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "production" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; + !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; - !(typeof length === 'number') ? "production" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; + !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; - !(length === 0 || length - 1 in obj) ? "production" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; + !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; - !(typeof obj.callee !== 'function') ? "production" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; + !(typeof obj.callee !== 'function') ? "development" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; // Old IE doesn't give collections access to hasOwnProperty. Assume inputs // without method will throw during the slice call and skip straight to the @@ -534,7 +534,7 @@ function getNodeName(markup) { */ function createNodesFromMarkup(markup, handleScript) { var node = dummyNode; - !!!dummyNode ? "production" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0; + !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0; var nodeName = getNodeName(markup); var wrap = nodeName && getMarkupWrap(nodeName); @@ -551,7 +551,7 @@ function createNodesFromMarkup(markup, handleScript) { var scripts = node.getElementsByTagName('script'); if (scripts.length) { - !handleScript ? "production" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected