-
-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
- Loading branch information
1 parent
41c5f94
commit fa9c418
Showing
11 changed files
with
137 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ dist | |
.netlify/ | ||
|
||
public/shiki | ||
public/emojis | ||
|
||
*~ | ||
*swp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { emojiFilename, emojiPrefix, emojiRegEx } from '@iconify-emoji/twemoji' | ||
import type { EmojiRegexMatch } from '@iconify/utils/lib/emoji/replace/find' | ||
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find' | ||
|
||
// Re-export everything from package | ||
export * from '@iconify-emoji/twemoji' | ||
|
||
// Package name | ||
export const iconifyEmojiPackage = '@iconify-emoji/twemoji' | ||
|
||
export function getEmojiAttributes(input: EmojiRegexMatch | string) { | ||
const match = typeof input === 'string' | ||
? getEmojiMatchesInText(emojiRegEx, input)?.[0] | ||
: input | ||
const file = emojiFilename(match) | ||
const className = `iconify-emoji iconify-emoji--${emojiPrefix}${file.padding ? ' iconify-emoji-padded' : ''}` | ||
return { | ||
class: className, | ||
src: `/emojis/${emojiPrefix}/${file.filename}`, | ||
alt: match.match, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.