smart-avatar
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "smart-avatar", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Render avatars with dynamic, defined fallback", | ||
"main": "./dist/smart-avatar.js", | ||
"main": "./dist/index.js", | ||
"directories": { | ||
@@ -13,5 +13,3 @@ "lib": "./lib" | ||
"scripts": { | ||
"build": "webpack && gulp --gulpfile ./gulpfile.browser.js", | ||
"build:browser": "gulp --gulpfile ./gulpfile.browser.js", | ||
"build:demo": "gulp --gulpfile ./gulpfile.demo.js", | ||
"build": "gulp --gulpfile ./gulpfile.js && terser --compress --mangle --output dist/index.js -- dist/index.js", | ||
"test": "jest ./test/automated/*", | ||
@@ -50,3 +48,5 @@ "test:manual": "gulp --gulpfile ./test/manual/gulpfile.test.js && http-server ./test/manual -p 7878" | ||
"gulp-replace": "^1.0.0", | ||
"gulp-strip-comments": "^2.5.2", | ||
"jest": "^24.1.0", | ||
"terser": "^4.6.11", | ||
"webpack": "^4.29.0", | ||
@@ -53,0 +53,0 @@ "webpack-cli": "^3.2.1" |
@@ -1,4 +0,5 @@ | ||
# smart-avatar [![Build Status](https://travis-ci.com/jaredgorski/smart-avatar.svg?branch=master)](https://travis-ci.com/jaredgorski/smart-avatar) <img align="left" height="100" src="https://raw.githubusercontent.com/jaredgorski/smart-avatar/master/.media/smartfox%40640.png"> | ||
Render avatars with dynamic, defined fallback | ||
# smart-avatar [![Build Status](https://travis-ci.com/jaredgorski/smart-avatar.svg?branch=master)](https://travis-ci.com/jaredgorski/smart-avatar) ![David](https://img.shields.io/david/jaredgorski/smart-avatar) ![npm bundle size](https://img.shields.io/bundlephobia/min/smart-avatar.svg) <img align="left" height="100" src="https://raw.githubusercontent.com/jaredgorski/smart-avatar/master/.media/smartfox%40640.png"> | ||
Render avatars with dynamic, defined fallbackI | ||
![](https://github.com/jaredgorski/smart-avatar/raw/master/.media/smart-avatar_demo.gif) | ||
@@ -33,4 +34,5 @@ | ||
### https://smart-avatar-demo.jaredgorski6.now.sh/ | ||
### https://jaredgorski.com/work/smart-avatar/demo | ||
--- | ||
@@ -43,4 +45,3 @@ | ||
```javascript | ||
import smartAvatar from 'smart-avatar'; | ||
import smartAvatar from 'smart-avatar' | ||
const targetElement = document.querySelector('.topbar-user'); | ||
@@ -185,2 +186,3 @@ | ||
_Note: `color` and `textColor` only matter in the case of a non-Gravatar icon or an initials avatar._ | ||
_Also note: in the future, the initials avatar will be made more available, rather than simply being a fallback option._ | ||
@@ -222,3 +224,15 @@ ## "unstyled" Flag | ||
## Disposal | ||
```javascript | ||
import smartAvatar from 'smart-avatar'; | ||
const targetElement = document.querySelector(.topbar-user); | ||
// ... code ... | ||
smartAvatar(targetEl, 'dispose'); | ||
``` | ||
There may come a time where you want to dispose of all smart-avatar assets that are child-nodes of a given element. By passing a parent element alongside the string `dispose` in place of the configuration object, you can remove all smart-avatar nodes from the given parent element. | ||
# Available Icon Options | ||
@@ -278,3 +292,2 @@ | ||
# Coming Soon: | ||
- UMD standardization: no need to import a separate file in ES modules. | ||
- General improvements: whatever I find necessary, and whatever you suggest! Make issues and send PRs please :smiley: |
Sorry, the diff of this file is not supported yet
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
67161
289
10
4
3
70
0
1