You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. emoji-mart-vue is a great project.
I've decided to use emoji-mart-vue for my web service dev project. In order to support a wide variety of emoji, I have added
Add support for more than one custom category missive#351
This feature is already supported in emoji-mart, but I have brought the code to emoji-mart-vue as well.
constfs=require('fs')const_=require('lodash')constpath=require('path')constxml2js=require('xml2json')consticons={human:{src:fs.readdirSync('other/human/').map(fname=>({title:path.basename(fname,'.svg'),shortname:path.basename(fname,'.svg')})),emojis:[]},simple:{src:require('simple-icons'),emojis:{}},health:{src:require('health-icons/public/icons/meta-data.json'),emojis:[]},weather:{src:xml2js.toJson(fs.readFileSync(path.resolve(__dirname,'node_modules/weather-icons/values/weathericons.xml')),{object:true}).resources.string,emojis:[]},humanitarian:{src:fs.readdirSync('other/humanitarian/').map(fname=>({title:path.basename(fname,'.svg'),shortname:path.basename(fname,'.svg')})),emojis:{}}}functionGetObject(namespace,customCategory,name,short_names,keywords,imageUrl){return{
customCategory,name:_.startCase(name),short_names:short_names.map(v=>(namespace+'_'+v).toLocaleLowerCase()),keywords:keywords.concat(namespace).map(v=>v.toLowerCase()),
imageUrl
}}icons.human.emojis=_.map(icons.human.src,(c)=>{returnGetObject('human','Human',c.title,[c.shortname],c.title.split(' '),`asset/icon/human/${c.title}.svg`)})icons.simple.emojis=_.map(icons.simple.src,(c)=>{returnGetObject('simple','Simple',c.title,[c.slug],_.split(c.title,' '),`asset/icon/simple/${c.slug}.svg`)})icons.health.emojis=_.map(icons.health.src,(c)=>{returnGetObject('health','Health',c.title,[_.replace(c.path,/\//g,'_')],c.tags,`asset/icon/health/${c.path}.svg`)})icons.weather.emojis=_.reduce(icons.weather.src,(a,c)=>{varalias=['wi_wu_','wi_owm_\\d','wi_moon_\\d','wi_yahoo_\\d','wi_forecast_io_','wi_owm_day_\\d','wi_wmo4680_\\d','wi_owm_day_\\d','wi_owm_night_\\d']if(c.name.match(newRegExp(alias.join('|')),'g')){// do not use alias}else{c.title=_.chain(c.name).replace(/_/g,' ').replace(/^wi/,'').value()a.push(GetObject('weather','Weather',c.title,[_.replace(c.name,/^wi_/,'')],c.title.split(' '),`asset/icon/weather/${_.replace(c.name,/_/g,'-')}.svg`))}returna},[])icons.humanitarian.emojis=_.map(icons.humanitarian.src,(c)=>{returnGetObject('humanitarian','Humanitarian',_.replace(c.title,/-/g,' '),[_.replace(c.shortname,/-/g,'_')],c.title.split('-'),`asset/icon/humanitarian/${c.title}.svg`)},{})fs.writeFileSync('icons.json',JSON.stringify([].concat(icons.human.emojis,icons.health.emojis,icons.simple.emojis,icons.weather.emojis,icons.humanitarian.emojis)))
Hi. emoji-mart-vue is a great project.
I've decided to use emoji-mart-vue for my web service dev project. In order to support a wide variety of emoji, I have added
Add support for more than one custom category missive#351
This feature is already supported in emoji-mart, but I have brought the code to emoji-mart-vue as well.
https://github.com/simple-icons/simple-icons
https://github.com/resolvetosavelives/healthicons
https://github.com/erikflowers/weather-icons
https://www.noupe.com/essentials/exclusive-freebie-on-noupe-human-pictos-with-500-icons-of-everyday-people-80392.html
https://brand.unocha.org/d/xEPytAUjC3sH/icons
Some icons do not show, but that is a problem on the part of the icon set.
erikflowers/weather-icons#248
resolvetosavelives/healthicons#132
src/utils/emoji-data.js
src/utils/shared-props.js
src/components/Picker.vue
src/components/anchor.vue
package.json
export.js
Example
thank you :-)
The text was updated successfully, but these errors were encountered: