Code Monkey home page Code Monkey logo

ngx-emoji-mart's Introduction

ngx-emoji-mart

npm codecov

DEMO: https://ngx-emoji-mart.vercel.app

This project is a port of emoji-mart by missive.

Installation

npm install @ctrl/ngx-emoji-mart
# Or if you're using yarn
yarn add @ctrl/ngx-emoji-mart
# Or if you're using pnpm
pnpm install @ctrl/ngx-emoji-mart

Dependencies

Latest version available for each version of Angular

@ctrl/ngx-emoji-mart Angular
1.0.6 8.x
3.1.0 9.x
5.1.2 10.x 11.x
6.2.0 12.x 13.x
7.1.0 14.x
8.2.0 15.x
current >=16.x

Components

Picker

Add PickerComponent to your module imports:

import { PickerComponent } from '@ctrl/ngx-emoji-mart';

@NgModule({
  imports: [PickerComponent],
})
export class AppModule {}

// Or if using standalone components

@Component({
  standalone: true,
  imports: [PickerComponent],
})
export class AppComponent {}

Import styles in styles.scss:

@import '@ctrl/ngx-emoji-mart/picker';

Or bundle those styles through angular.json configuration:

"build": {
  "options": {
    "styles": [
      "src/styles.scss",
      "node_modules/@ctrl/ngx-emoji-mart/picker.css"
    ]
  }
}

Now we can use the emoji-mart component:

<emoji-mart title="Pick your emoji…" emoji="point_up"></emoji-mart>
<emoji-mart set="emojione"></emoji-mart>
<emoji-mart (emojiClick)="addEmoji($event)"></emoji-mart>
<emoji-mart [style]="{ position: 'absolute', bottom: '20px', right: '20px' }"></emoji-mart>
<emoji-mart
  [i18n]="{ search: 'Recherche', categories: { search: 'Résultats de recherche', recent: 'Récents' } }"
></emoji-mart>
Prop Default Description
autoFocus false Auto focus the search input when mounted
color #ae65c5 The top bar anchors select and hover color
emoji department_store emoji shown when no emojis are hovered, set to an empty string to show nothing
darkMode varies Dark mode (boolean). true by default if the browser reports prefers-color-scheme: dark.
include [] Only load included categories. Accepts I18n categories keys. Order will be respected, except for the recent category which will always be the first.
exclude [] Don't load excluded categories. Accepts I18n categories keys.
custom [] Custom emojis
recent Pass your own frequently used emojis as array of string IDs
emojiSize 24 The emoji width and height
(emojiClick) not triggered on return key in search bar. Params: { emoji, $event }
(emojiSelect) whenever an emoji is selected. returns { emoji, $event }
perLine 9 Number of emojis per line. While there’s no minimum or maximum, this will affect the picker’s width. This will set Frequently Used length as well (perLine * totalFrequentLines (4))
totalFrequentLines 4 number of lines of frequently used emojis
i18n {…} An object containing localized strings
isNative false Renders the native unicode emoji
set apple The emoji set: 'apple', 'google', 'twitter', 'facebook'
sheetSize 64 The emoji sheet size: 16, 20, 32, 64
backgroundImageFn ((set, sheetSize) => …) A Fn that returns that image sheet to use for emojis. Useful for avoiding a request if you have the sheet locally.
imageUrlFn ((emoji) => string) A Fn that returns the url used for the given emoji. Useful for fetching your own assets.
emojisToShowFilter ((emoji) => true) A Fn to choose whether an emoji should be displayed or not
showPreview true Display preview section
enableSearch true Display search bar
emojiTooltip false Show emojis short name when hovering (title)
skin 1 Default skin color: 1, 2, 3, 4, 5, 6
style Inline styles applied to the root element. Useful for positioning
title Emoji Mart™ The title shown when no emojis are hovered
hideObsolete true Hides ex: "cop" emoji in favor of female and male emoji
notFoundEmoji sleuth_or_spy The emoji shown when there are no search results
categoriesIcons see svgs/index.ts the anchor icons
searchIcons see svgs/index.ts the search/close icon in the search bar
showSingleCategory show only one category at a time to increase rendering performance
useButton false Uses button elements for emoji instead of spans
enableFrequentEmojiSort false Enables re-sorting of emoji on click
virtualize false Enables experimental virtualized rendering to render only emoji categories in view
virtualizeOffset 0 use with virtualize option to add or subtract the amount of pixels used to determine whether or not render the category

I18n

search: 'Search',
emojilist: 'List of emoji',
notfound: 'No Emoji Found',
clear: 'Clear',
categories: {
  search: 'Search Results',
  recent: 'Frequently Used',
  people: 'Smileys & People',
  nature: 'Animals & Nature',
  foods: 'Food & Drink',
  activity: 'Activity',
  places: 'Travel & Places',
  objects: 'Objects',
  symbols: 'Symbols',
  flags: 'Flags',
  custom: 'Custom',
},
skintones: {
  1: 'Default Skin Tone',
  2: 'Light Skin Tone',
  3: 'Medium-Light Skin Tone',
  4: 'Medium Skin Tone',
  5: 'Medium-Dark Skin Tone',
  6: 'Dark Skin Tone',
},

Sheet sizes

Sheets are served from unpkg, a global CDN that serves files published to npm.

Set sheetSize Size
apple 16 334 KB
apple 20 459 KB
apple 32 1.08 MB
apple 64 2.94 MB
facebook 16 322 KB
facebook 20 439 KB
facebook 32 1020 KB
facebook 64 2.5 MB
google 16 301 KB
google 20 409 KB
google 32 907 KB
google 64 2.17 MB
twitter 16 288 KB
twitter 20 389 KB
twitter 32 839 KB
twitter 64 1.82 MB

Examples of emoji object:

{
  id: 'smiley',
  name: 'Smiling Face with Open Mouth',
  colons: ':smiley:',
  text: ':)',
  emoticons: [
    '=)',
    '=-)'
  ],
  skin: null,
  native: '😃'
}

{
  id: 'santa',
  name: 'Father Christmas',
  colons: ':santa::skin-tone-3:',
  text: '',
  emoticons: [],
  skin: 3,
  native: '🎅🏼'
}

{
  id: 'octocat',
  name: 'Octocat',
  colons: ':octocat',
  text: '',
  emoticons: [],
  custom: true,
  imageUrl: 'https://github.githubassets.com/images/icons/emoji/octocat.png'
}

Emoji

Add EmojiComponent to your module or standalone component imports:

import { EmojiComponent } from '@ctrl/ngx-emoji-mart/ngx-emoji';
<ngx-emoji [emoji]="{ id: 'santa', skin: 3 }" size="16"></ngx-emoji>
<ngx-emoji emoji=":santa::skin-tone-3:" size="16"></ngx-emoji>
<ngx-emoji emoji="santa" set="emojione" size="16"></ngx-emoji>

| Prop | Required | Default | Description | | -------------------------------------------- | :------: | ------------------------- | ---------------------------------------------------------------------------------------------------------------- | --- | | emoji | ✓ | | Either a string or an emoji object | | size | ✓ | | The emoji width and height. | | isNative | | false | Renders the native unicode emoji | | (emojiClick) | | | Params: { emoji, $event } | | (emojiLeave) | | | Params: { emoji, $event } | | (emojiOver) | | | Params: { emoji, $event } | | fallback | | | Params: (emoji, props) => {} | | set | | apple | The emoji set: 'apple', 'google', 'twitter', 'emojione' | | sheetSize | | 64 | The emoji sheet size: 16, 20, 32, 64 | | backgroundImageFn | | ((set, sheetSize) => …) | Fn that returns that image sheet to use for emojis. Useful for avoiding a request if you have the sheet locally. | | skin | | 1 | Skin color: 1, 2, 3, 4, 5, 6 | | tooltip | | false | Show emoji short name when hovering (title) | | | hideObsolete | | false | Hides ex: "cop" emoji in favor of female and male emoji | | | useButton | | false | Uses button element instead of span | |

Unsupported emojis fallback

Certain sets don’t support all emojis (i.e. Facebook doesn't support :shrug:). By default the Emoji component will not render anything so that the emojis’ don’t take space in the picker when not available. When using the standalone Emoji component, you can however render anything you want by providing the fallback props.

To have the component render :shrug: you would need to:

emojiFallback = (emoji: any, props: any) => (emoji ? `:${emoji.shortNames[0]}:` : props.emoji);
<ngx-emoji set="twitter" emoji="shrug" size="24" [fallback]="emojiFallback"></ngx-emoji>

Custom emojis

You can provide custom emojis which will show up in their own category. You can either use a single image as imageUrl or use a spritesheet as shown in the second object.

const customEmojis = [
  {
    name: 'Octocat',
    shortNames: ['octocat'],
    text: '',
    emoticons: [],
    keywords: ['github'],
    imageUrl: 'https://github.githubassets.com/images/icons/emoji/octocat.png',
  },
  {
    name: 'Test Flag',
    shortNames: ['test'],
    text: '',
    emoticons: [],
    keywords: ['test', 'flag'],
    spriteUrl: 'https://cdn.jsdelivr.net/npm/[email protected]/img/twitter/sheets-256/64.png',
    sheet_x: 1,
    sheet_y: 1,
    size: 64,
    sheetColumns: 61,
    sheetRows: 60,
  },
];
<emoji-mart [custom]="customEmojis"></emoji-mart>

Headless search

The Picker doesn’t have to be mounted for you to take advantage of the advanced search results.

import { EmojiSearch } from '@ctrl/ngx-emoji-mart';

class ex {
  constructor(private emojiSearch: EmojiSearch) {
    this.emojiSearch.search('christmas').map(o => o.native);
    // => [🎄, 🎅🏼, 🔔, 🎁, ⛄️, ❄️]
  }
}

Display emoji as custom element

// $event is from (emojiClick)
const styles = this.emoji.emojiSpriteStyles($event.emoji.sheet, 'twitter'); // pass emoji sheet
const el = document.createElement('div');
Object.assign(el.style, styles); // apply styles to new element
document.body.appendChild(el);

Storage

By default EmojiMart will store user chosen skin and frequently used emojis in localStorage.

Possible keys are:

Key Value Description
skin 1, 2, 3, 4, 5, 6
frequently { 'astonished': 11, '+1': 22 } An object where the key is the emoji name and the value is the usage count
last 'astonished' (Optional) Used by frequently to be sure the latest clicked emoji will always appear in the “Recent” category

Features

Powerful search

Short name, name and keywords

Not only does Emoji Mart return more results than most emoji picker, they’re more accurate and sorted by relevance.

summer

Emoticons

The only emoji picker that returns emojis when searching for emoticons.

emoticons

Fully customizable

Anchors color, title and default emoji

customizable-color
pick-your-emoji

Emojis sizes and length

size-and-length

Default skin color

As the developer, you have control over which skin color is used by default.

skins

It can however be overwritten as per user preference.

customizable-skin

Multiple sets supported

Apple / Google / Twitter / Facebook

sets


GitHub @scttcper  ·  Twitter @scttcper

ngx-emoji-mart's People

Contributors

agiangrant avatar angular-cli avatar arturovt avatar biophoton avatar brankostancevic avatar cakeinpanic avatar cslecours avatar danielkucal avatar endrzei avatar floatebcont avatar lentschi avatar mattlewis92 avatar mlapaglia avatar renovate-bot avatar renovate[bot] avatar s-moran avatar scttcper avatar soundlake avatar urish avatar wobkenh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngx-emoji-mart's Issues

Website broken

https://typectrl.github.io/ngx-emoji-mart/

ERROR TypeError: Cannot read property '0' of undefined
    at main.cd8c21bfc1011afbeb5d.js:1
    at Array.map (<anonymous>)
    at e.ngOnInit (main.cd8c21bfc1011afbeb5d.js:1)
    at main.cd8c21bfc1011afbeb5d.js:1
    at main.cd8c21bfc1011afbeb5d.js:1
    at xd (main.cd8c21bfc1011afbeb5d.js:1)
    at tu (main.cd8c21bfc1011afbeb5d.js:1)
    at Object.updateDirectives (main.cd8c21bfc1011afbeb5d.js:1)
    at Object.updateDirectives (main.cd8c21bfc1011afbeb5d.js:1)
    at Ad (main.cd8c21bfc1011afbeb5d.js:1)

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository with URL https://github.com/TypeCtrl/ngx-emoji-mart.git.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment and make sure the repositoryUrl is configured with a valid Git URL.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Filter Not Working

Filter not working when i initialise it after click on any emoji filter work perfect
screenshot 1

Wrong tooltip for category

The titles within the category header display angular code instead of the (localized) name. This can be seen in the official demo. I suppose the error is because of the following line:
https://github.com/TypeCtrl/ngx-emoji-mart/blob/27c3c3532d04f9179b752c51584aae078060c15d/src/lib/picker/anchors.component.ts#L19
This binding doesn't evaluate and simply uses provided string. To solve this issue you would have to write

title="{{i18n.categories[category.id]}}"

or

[attr.title]="i18n.categories[category.id]"

As the i18n object doesn't exist in the anchors.component yet, that would also have to be added

Cannot import picker.css file with webpack import

Hello!
I'm importing emoji-mart css using import '@ctrl/ngx-emoji-mart/picker.css'; code, but that does not work for webpack production build, as the import is being removed because of sideEffects: false flag in package.json. Here is an explanation: webpack-contrib/mini-css-extract-plugin#102 (comment)
It would be great if the package.json file could be altered as described in that comment, so we do not have to make some dirty workarounds.

To be clear, our projecct does not use cli (we have our own webpack configuration) and we do not import emoji-mart css via sass @import, as importing css files from scss file is considered a deprecated behavior and will be removed in the near future.

Hide SearchBar / Side of the iconsPanel

Hi,
I'm checking your documentation if is possible to hide the searchbar but I didn't find it.
Do you think is possible to hide it by a new parameter?

My second question is if is possible, like you have in the perLine (horizontally), if is possible to select the number of icons to show "vertically".
Thank you.

Feature request: provide storage option

It would be great to be able to provide a custom storage provider instead of defaulting to localStorage. In my case, I would like to pass Storage from @ionic/storage which uses IndexedDB by default. Basically, the Storage provider only needs to implement getItem, setItem and removeItem to be compatible with most storage providers.

Passing an unsupported emoji string causes exception and fallback not working

As I understood from the docs passing an unsupported emoji will just not render anything. Or use the fall back if provided. However it just results in an exception because of a string/object type mismatch. I was able to get it working for by passing in an object instead. However the fallback is never called if my emoji inside the object is unsupported. For our use case it would also be very useful if you could have the option to just render the 'emoji text' if the emoji name passed in is not supported. Would that be possible? Attached you can find the exception that's being thrown:

error

how to get custom emoji object.native icon if i am using image for custom emoji

suppose for this object

let obj = {
id: 'santa',
name: 'Father Christmas',
colons: ':santa::skin-tone-3:',
text: '',
emoticons: [],
skin: 3,
native: '🎅🏼'
}

HERE i am getting native icon by using obj.native to render in view

BUT HERE - in this case

let obj1 = {
id: 'octocat',
name: 'Octocat',
colons: ':octocat',
text: '',
emoticons: [],
custom: true,
imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/octocat.png?v7',
native:'',
}

How to get obj1.native , and how to fill that native icon for custom emoji added.

NullInjectorError: No provider for e! when adding this lib in a custom component

I have a Angular 6 (Lazy Load) Application and I created a component do reuse the emoji picker across my application, It works fine. But once I try to use it in --prod mode, it shows me the error:

ERROR Error: StaticInjectorError(u)[e -> e]: StaticInjectorError(Platform: core)[e -> e]: NullInjectorError: No provider for e! at e.get (core.js:1062) at core.js:1307 at e (core.js:1251) at e.get (core.js:1147) at core.js:1307 at e (core.js:1251) at e.get (core.js:1147) at So (core.js:8328) at e.get (core.js:9020) at So (core.js:8328)

I've followed the logs and figured out that the errors are in ctrl-ngx-emoji-mart.js: EmojiFrequentlyService and EmojiService that are not being found. I've added both as providers in my component (not sure if it's the right thing to do).

EmojiFrequentlyService worked, but EmojiService did not. I can't compile after adding because it throws this error:

Module not found: Error: Can't resolve '@ctrl/ngx-emoji-mart/ngx-emoji/public_api'

Any clues for what is happening?

Dependency deprecation warning: travis-deploy-once (npm)

On registry https://registry.npmjs.org/, the "latest" version (v5.0.11) of dependency travis-deploy-once has the following deprecation notice:

We recommend to use Travis Build Stages instead

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about travis-deploy-once's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

EmojiModule not found and could not use EmojiService in my component. Angular 7.1.0 and TypeScript 3.1.6

I am using ngx-emoji-mart in my angular chat application. I am using Angular 7.1.0 and TypeScript 3.1.6.

EmojiModule could not be resolved in my Chat Module. I cannot import it. Angular gives EmojiModule not resolved. Other than this, I could not use EmojiService in my component. I am importing EmojiService in my component like this:
constructor(public emoji: EmojiService) {}

Component HTML:
<emoji-mart (emojiClick)="addEmoji($event)" class='emoji-mart'></emoji-mart>
TS:
//addEmoji function
addEmoji(event){ const styles = this.emoji.emojiSpriteStyles($event.emoji.sheet, 'twitter'); // pass emoji sheet }

I cannot use this.emoji.emojiSpriteStyles()
I have searched a lot around ngx-emoji-mart github issues but nothing worked for me. Thanks

Question: Is it possible and how to specify width: 100% for picker?

I see that width is computed here:
https://github.com/TypeCtrl/ngx-emoji-mart/blob/0ec517cb0b12a61540bc0b63fa592cca52d11f53/src/lib/picker/picker.component.html#L2

Need to have a picker that fits a re-sizeable chat container <div>.

Tried many things:
Editing the div .emoji-mart 's width in console to 100% behaves as desired.
The following does not work.
<emoji-mart title="Pick your emoji…" emoji="point_up" [style]="{ width: '100%' }"></emoji-mart>

Issue with typings

Hello,

thanks for your effort so far. I've just added ngx-emoji-mart to my project and I receive some typing errors. I'm using it in a lazy loaded feature module of a almost fresh Angular CLI project. The errors prevent my app from building - but if I change another file the build is running through. There are no runtime errors in the browser - everything works fine expect my build/serve keeps throwing those errors. So it is probably only a issue with exported typings..

ERROR in node_modules/@ctrl/ngx-emoji-mart/anchors.component.d.ts(2,31): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/category.component.d.ts(2,37): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-frequently.service.d.ts(1,27): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-search.service.d.ts(1,41): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/picker.component.d.ts(2,50): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/preview.component.d.ts(2,41): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/skins.component.d.ts(2,23): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.

My versions:

Angular CLI: 1.6.8
Node: 7.7.3
OS: linux x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.2.0
@angular/cli: 1.6.8
@angular/material: 5.2.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Unexpected value 'PickerModule' when i 'ng build --prod'

ERROR in : Unexpected value 'PickerModule in E:/Programings/angular/ng-emoji-picker-demo/node_modules/@ctrl/ngx-emoji-mart/picker.module.d.ts' imported by the module 'AppModule in E:/Programings/angular/ng-emoji-picker-demo/src/app/app.module.ts'. Please add a @NgModule annotation.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Could not resolve the module's components

I installed the module and started the server using ng serve on angular 5 and got the following on the console:

ERROR in @ctrl\ngx-emoji-mart\ctrl-ngx-emoji-mart.ts(25,40): Error during template compile of 'PickerModule'
  Could not resolve @ctrl/ngx-emoji-mart/ngx-emoji relative to C:/workspace/stash/amc/angular/node_modules/@ctrl/ngx-emoji-mart/ctrl-ngx-emoji-mart.d.ts..
node_modules/@ctrl/ngx-emoji-mart/anchors.component.d.ts(2,31): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-frequently.service.d.ts(1,27): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/category.component.d.ts(2,37): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-search.service.d.ts(1,41): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/picker.component.d.ts(2,61): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/preview.component.d.ts(2,41): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/skins.component.d.ts(2,23): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.

Search returning no results when [include] or [exclude] set on <emoji-mart>

For example, using the code below gives a blank search results area. Should be able to search within 'people' category. Works as expected when [include] is removed.

<emoji-mart set="apple" [title]="''" [emojiSize]="16" [emoji]="''" 
[totalFrequentLines]="1" [perLine]="8" (emojiClick)="emojiClick($event)" [include]="['people']">
</emoji-mart>

Change cdn direction

Hello, I have been using this library and I'm wondering if there is any form to change the CDN given that I want to use it without direct access to internet and only using the native emojis brings a problem with the different OS (some users are using linux and w7 so they dont get most emojis)

modules not found

What I tried:
npm install @ctrl/ngx-emoji-mart

imported both

import { PickerModule } from '@ctrl/ngx-emoji-mart'
import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji'

and added them to the import section of my ngmodule
added the css import

But I'm getting these error when I'm trying to serve my app:

node_modules/@ctrl/ngx-emoji-mart/anchors.component.d.ts(2,31): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/category.component.d.ts(2,37): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-frequently.service.d.ts(1,27): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/emoji-search.service.d.ts(1,41): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/picker.component.d.ts(2,61): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/preview.component.d.ts(2,48): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
node_modules/@ctrl/ngx-emoji-mart/skins.component.d.ts(2,23): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.
src/modules/recognition/recognition.module.ts(33,29): error TS2307: Cannot find module '@ctrl/ngx-emoji-mart/ngx-emoji'.

I did an npm ls @ctrl/ngx-emoji-mart just to be sure and also checked node_modules and it's listed there.

I also tried to install the 0.9.0 release just in case the v0.10 was broken, same thing.

What am I doing wrong here ?

Improve emoji-mart picker performance

The current picker component is quite heavy (from a UI perspective) when showing all categories on picker popup (especially painful in IE11). From my experience, this is due to having too many components in an *ngFor.

One potential solution would be to provide an option to "tab" the categories. So instead of having all emojis in one big list, you render a new tab each time the user selects a category from the top menu. That would make it fast since when the picker first appears it only loads one (the default) category instead of all of them at once.

custom emojis broken

When I try to do this:
<ngx-emoji [custom]="customEmojis"></ngx-emoji>

I get the following error:

Uncaught Error: Template parse errors:
Can't bind to 'custom' since it isn't a known property of 'ngx-emoji'.

I can indeed confirm in the source code that the emoji component does not accept a custom data array:
https://github.com/TypeCtrl/ngx-emoji-mart/blob/master/src/lib/emoji/emoji.component.ts#L83

I guess the documentation is out of sync: https://github.com/TypeCtrl/ngx-emoji-mart/blame/master/README.md#L249

What is the current/recommended way of rendering custom emojis?

Emojis are split vertically in Firefox

screenshot 2018-10-22 14 50 02

I can raise a PR but this feels fairly straightforward by simply changing the display properties in emoji.component.ts to inline as opposed to inline-block.

custom emoji example type error

When using the custom emoji example from the docs:

const customEmojis = [
  {
    name: 'Octocat',
    short_names: ['octocat'],
    text: '',
    emoticons: [],
    keywords: ['github'],
    imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/octocat.png?v7'
  },
]

I get this trace when opening the picker:

Error: Uncaught (in promise): TypeError: Cannot create property 'custom' on string 'octocat'
TypeError: Cannot create property 'custom' on string 'octocat'
    at EmojiService.webpackJsonp.1225.EmojiService.getData (http://localhost:8100/build/49.js:25919:30)
    at http://localhost:8100/build/49.js:341:73
    at Array.filter (<anonymous>)
    at CategoryComponent.webpackJsonp.1224.CategoryComponent.getEmojis (http://localhost:8100/build/49.js:341:22)
    at CategoryComponent.webpackJsonp.1224.CategoryComponent.ngOnInit (http://localhost:8100/build/49.js:287:28)
    at checkAndUpdateDirectiveDynamic (http://localhost:8100/build/vendor.js:12773:19)
    at checkAndUpdateNodeDynamic (http://localhost:8100/build/vendor.js:14290:20)
    at checkAndUpdateNode (http://localhost:8100/build/vendor.js:14214:16)
    at debugCheckAndUpdateNode (http://localhost:8100/build/vendor.js:15104:76)
    at debugCheckDirectivesFn (http://localhost:8100/build/vendor.js:15045:13)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at http://localhost:8100/build/polyfills.js:3:19174
    at http://localhost:8100/build/polyfills.js:3:21242
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at Object.onInvoke (http://localhost:8100/build/vendor.js:5124:33)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at http://localhost:8100/build/polyfills.js:3:20242
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)
    at Object.onInvokeTask (http://localhost:8100/build/vendor.js:5115:33)

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularmaterial). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Reverse sorting of emoji mart in IE 11

The sorting of the emojis seems to be different in IE 11. In chrome and firefox smiles are displayed first whereas IE 11 displays all the flags first. This is very annoying for users because this means the most used emojis are somewhere on the bottom. The most recent section is the same on IE and other browsers

How to change frequently used emojis count formula?

Hello
In our design, we fit 13 emojis in one line, so, based on formula, that's 13 * 4 emojis displayed in 'frequently used' area. Because, the emoji picker container's height is small, frequently used uses way too much space.
I was wondering if there's a simple way to hardcode/change the calculation function so that we can get fewer frequently used emojis.
Thanks

cannot use backgroundImageFn

I tried to use backgroundImageFn to load the emoji sheet locally

  <emoji-mart *ngIf="toggled" title="" [showPreview]="false"
                                                id="post-emoji-picker" (window:mouseup)="mouseUp($event)"
                                                (emojiClick)="addEmoji($event)"
                                                [backgroundImageFn]="backgroundImageFn"></emoji-mart>
 @Input()
    backgroundImageFn: Emoji['backgroundImageFn'] = (
        set: string,
        sheetSize: number,
    ) =>
        'assets/emoji-picker.png'

but it still load from unpkg.com

When emoji image is needed

The goal: user wants to replace native unicode emojis by images or insert it into a contentEditable.
The problems:

  1. Dynamically created components can't be inserted to DOM in proper place.
  2. Performance: many components make it slow. We can already observe it while opening emoji picker.

The workaround is to dynamically create the component, set emoji properties like id and set, call ngOnChanges(), hide generated component, wait for it to load, take HTML, destroy generated component and finally replace the unicode emoji by image...

Desired solution: there should be built-in service method to get HTML code for given emoji, getter or field with HTML / style in EmojiEvent.
Which solution would be the best? If it is a method - which service is the most sufficient for it?

emojiSpriteStyles sample doesn't support skin variations

The sample you added under the headline Display emoji as custom element doesn't seem to support skin variations: $event.emoji.sheet doesn't contain any reference to the selected skin tone, so even if emojiSpriteStyles supported it (haven't checked!), it wouldn't get the information.

So the example code in your README.md always gives me sprites with pink faces.

Search does not work when [emojisToShowFilter] is used

When using the search bar in the picker, search always returns empty result when the picker is configured with [emojisToShowFilter].
When removing emojisToShowFilter, search works again as expected.

Reason might be in emoji-search-service.ts
emojisToShowFilter(this.emojiService.names[result.id]),
whereas it should rather be
emojisToShowFilter(result.unified)
as the filter is working with the unified codes and not names.

ionic 3 can't run my app when include this plugin (angular 5) last version work is 0.7.1

Uncaught TypeError: Object(...) is not a function
at ctrl-ngx-emoji-mart-ngx-emoji.js:23022
at Object. (ctrl-ngx-emoji-mart-ngx-emoji.js:23024)
at webpack_require (bootstrap ffc2c370be32b2c6526e:54)
at Object. (ctrl-ngx-emoji-mart.js:1)
at webpack_require (bootstrap ffc2c370be32b2c6526e:54)
at Object.430 (main.ts:5)
at webpack_require (bootstrap ffc2c370be32b2c6526e:54)
at Object.425 (main.ts:1)
at webpack_require (bootstrap ffc2c370be32b2c6526e:54)
at webpackJsonpCallback (bootstrap ffc2c370be32b2c6526e:25)

Double tap required on mobile devices

When selecting an emoji from the picker on a touch screen device (I tried it on iPhone SE & iPad), two taps are required to trigger the emojiSelect and/or emojiClick events and close the picker.
That behavior might well be intended! (Otherwise, if [showPreview]="true" is set it would be impossible to see said preview.)

However - when setting [showPreview]="true" it would be useful to have it react to a single tap. Therefore I suggest adding a new boolean Input (e.g. emitOnTouch) that causes this behavior.

Compatibility issue with IE 11 and weird native issue

After upgrading to the newest version which included the fix for the unsupported emojis, I raised in an earlier issue I now have the following problems:

  • In IE 11 I get console errors because somewhere 'includes' is used (screenshot below)
  • If I don't explicitly use native="false" on the ngx-emoji component I get duplicated emojis, but even when I set the native attribute and I inspect the DOM I still see the span with background image but it also has the unicode emoji as content inside the span (screenshot also below)

emoji_dup_error
emoji_error_ie

Blocking UI when open in modal

Hello,
Thank you for creating this with Angular.
I just added ngx-emoji-mart to my project and I got an issue when I put <emoji-mart set="twitter" title="Pick your emoji…" emoji="point_up"></emoji-mart> to modal body and It block the UI about 1 second when I open the modal.

It also block UI when I navigate to a screen that use emoji-mart.
I reproduce issue with navigating:
https://stackblitz.com/edit/angular-egigxh
https://angular-egigxh.stackblitz.io/

My package.json:

"@angular/animations": "^5.2.9",
"@angular/common": "^5.2.9",
"@angular/compiler": "^5.2.9",
"@angular/core": "^5.2.9",
"@angular/forms": "^5.2.9",
"@angular/http": "^5.2.9",
"@angular/platform-browser": "^5.2.9",
"@angular/platform-browser-dynamic": "^5.2.9",
"@angular/platform-server": "^5.2.9",
"@angular/router": "^5.2.9",
"@ctrl/ngx-emoji-mart": "^0.2.1",
"@ng-bootstrap/ng-bootstrap": "^1.1.1",
"core-js": "^2.5.4",
"ng2-device-detector": "^1.0.1",
"rxjs": "^5.5.8",
"typed.js": "^2.0.6",
"zone.js": "^0.8.25"

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Missing package.json file.

A package.json file at the root of your project is required to release on npm.

Please follow the npm guideline to create a valid pacakge.json file.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.