editium
Version:
A powerful and feature-rich React rich text editor component built with Slate.js, featuring comprehensive formatting options, tables, images, find & replace, and more
2,220 lines (2,183 loc) • 3.78 MB
JavaScript
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React__default = require('react');
var slate = require('slate');
var slateReact = require('slate-react');
var slateHistory = require('slate-history');
var outline = require('@heroicons/react/24/outline');
function _mergeNamespaces(n, m) {
m.forEach(function (e) {
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
if (k !== 'default' && !(k in n)) {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
});
return Object.freeze(n);
}
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
// src/utils/asArray.ts
function asArray(v) {
return [].concat(v);
}
// src/utils/is.ts
function isPsuedoSelector(selector) {
return selector.startsWith(":");
}
function isStyleCondition(selector) {
return isString$1(selector) && (selector === "*" || selector.length > 1 && ":>~.+*".includes(selector.slice(0, 1)) || isImmediatePostcondition(selector));
}
function isValidProperty(property, value) {
return (isString$1(value) || typeof value === "number") && !isCssVariables(property) && !isPsuedoSelector(property) && !isMediaQuery(property);
}
function isMediaQuery(selector) {
return selector.startsWith("@media");
}
function isDirectClass(selector) {
return selector === ".";
}
function isCssVariables(selector) {
return selector === "--";
}
function isString$1(value) {
return value + "" === value;
}
function isImmediatePostcondition(value) {
return isString$1(value) && (value.startsWith("&") || isPsuedoSelector(value));
}
// src/utils/joinTruthy.ts
function joinTruthy(arr, delimiter = "") {
return arr.filter(Boolean).join(delimiter);
}
// src/utils/stableHash.ts
function stableHash(prefix, seed) {
let hash = 0;
if (seed.length === 0)
return hash.toString();
for (let i = 0; i < seed.length; i++) {
const char = seed.charCodeAt(i);
hash = (hash << 5) - hash + char;
hash = hash & hash;
}
return `${prefix ?? "cl"}_${hash.toString(36)}`;
}
// src/utils/stringManipulators.ts
function handlePropertyValue(property, value) {
if (property === "content") {
return `"${value}"`;
}
return value;
}
function camelCaseToDash(str) {
return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
function joinedProperty(property, value) {
return `${property}:${value}`;
}
function toClass(str) {
return str ? `.${str}` : "";
}
function appendString(base, line) {
return base ? `${base}
${line}` : line;
}
// src/Rule.ts
var Rule = class _Rule {
constructor(sheet, property, value, selector) {
this.sheet = sheet;
this.property = property;
this.value = value;
this.selector = selector;
this.property = property;
this.value = value;
this.joined = joinedProperty(property, value);
const joinedConditions = this.selector.preconditions.concat(
this.selector.postconditions
);
this.hash = this.selector.hasConditions ? this.selector.scopeClassName : stableHash(this.sheet.name, this.joined);
this.key = joinTruthy([this.joined, joinedConditions, this.hash]);
}
toString() {
let selectors = mergeSelectors(this.selector.preconditions, {
right: this.hash
});
selectors = mergeSelectors(this.selector.postconditions, {
left: selectors
});
return `${selectors} {${_Rule.genRule(this.property, this.value)}}`;
}
static genRule(property, value) {
const transformedProperty = camelCaseToDash(property);
return joinedProperty(
transformedProperty,
handlePropertyValue(property, value)
) + ";";
}
};
function mergeSelectors(selectors, { left = "", right = "" } = {}) {
const output = selectors.reduce((selectors2, current) => {
if (isPsuedoSelector(current)) {
return selectors2 + current;
}
if (isImmediatePostcondition(current)) {
return selectors2 + current.slice(1);
}
return joinTruthy([selectors2, current], " ");
}, left);
return joinTruthy([output, toClass(right)], " ");
}
var Selector = class _Selector {
constructor(sheet, scopeName = null, {
preconditions,
postconditions
} = {}) {
this.sheet = sheet;
this.preconditions = [];
this.scopeClassName = null;
this.scopeName = null;
this.postconditions = [];
this.preconditions = preconditions ? asArray(preconditions) : [];
this.postconditions = postconditions ? asArray(postconditions) : [];
this.setScope(scopeName);
}
setScope(scopeName) {
if (!scopeName) {
return this;
}
if (!this.scopeClassName) {
this.scopeName = scopeName;
this.scopeClassName = stableHash(
this.sheet.name,
// adding the count guarantees uniqueness across style.create calls
scopeName + this.sheet.count
);
}
return this;
}
get hasConditions() {
return this.preconditions.length > 0 || this.postconditions.length > 0;
}
addScope(scopeName) {
return new _Selector(this.sheet, scopeName, {
preconditions: this.preconditions,
postconditions: this.postconditions
});
}
addPrecondition(precondition) {
return new _Selector(this.sheet, this.scopeClassName, {
postconditions: this.postconditions,
preconditions: this.preconditions.concat(precondition)
});
}
addPostcondition(postcondition) {
return new _Selector(this.sheet, this.scopeClassName, {
preconditions: this.preconditions,
postconditions: this.postconditions.concat(postcondition)
});
}
createRule(property, value) {
return new Rule(this.sheet, property, value, this);
}
};
// src/Sheet.ts
var Sheet = class {
constructor(name, rootNode) {
this.name = name;
this.rootNode = rootNode;
// Hash->css
this.storedStyles = {};
// styles->hash
this.storedClasses = {};
this.style = "";
this.count = 0;
this.id = `flairup-${name}`;
this.styleTag = this.createStyleTag();
}
getStyle() {
return this.style;
}
append(css) {
this.style = appendString(this.style, css);
}
apply() {
this.count++;
if (!this.styleTag) {
return;
}
this.styleTag.innerHTML = this.style;
}
isApplied() {
return !!this.styleTag;
}
createStyleTag() {
if (typeof document === "undefined" || this.isApplied() || // Explicitly disallow mounting to the DOM
this.rootNode === null) {
return this.styleTag;
}
const styleTag = document.createElement("style");
styleTag.type = "text/css";
styleTag.id = this.id;
(this.rootNode ?? document.head).appendChild(styleTag);
return styleTag;
}
addRule(rule) {
const storedClass = this.storedClasses[rule.key];
if (isString$1(storedClass)) {
return storedClass;
}
this.storedClasses[rule.key] = rule.hash;
this.storedStyles[rule.hash] = [rule.property, rule.value];
this.append(rule.toString());
return rule.hash;
}
};
// src/utils/forIn.ts
function forIn(obj, fn) {
for (const key in obj) {
fn(key.trim(), obj[key]);
}
}
// src/cx.ts
function cx(...args) {
const classes = args.reduce((classes2, arg) => {
if (arg instanceof Set) {
classes2.push(...arg);
} else if (typeof arg === "string") {
classes2.push(arg);
} else if (Array.isArray(arg)) {
classes2.push(cx(...arg));
} else if (typeof arg === "object") {
Object.entries(arg).forEach(([key, value]) => {
if (value) {
classes2.push(key);
}
});
}
return classes2;
}, []);
return joinTruthy(classes, " ").trim();
}
// src/index.ts
function createSheet(name, rootNode) {
const sheet = new Sheet(name, rootNode);
return {
create,
getStyle: sheet.getStyle.bind(sheet),
isApplied: sheet.isApplied.bind(sheet)
};
function create(styles) {
const scopedStyles = {};
iteratePreconditions(sheet, styles, new Selector(sheet)).forEach(
([scopeName, styles2, selector]) => {
iterateStyles(sheet, styles2, selector).forEach(
(className) => {
addScopedStyle(scopeName, className);
}
);
}
);
sheet.apply();
return scopedStyles;
function addScopedStyle(name2, className) {
scopedStyles[name2] = scopedStyles[name2] ?? /* @__PURE__ */ new Set();
scopedStyles[name2].add(className);
}
}
}
function iteratePreconditions(sheet, styles, selector) {
const output = [];
forIn(styles, (key, value) => {
if (isStyleCondition(key)) {
return iteratePreconditions(
sheet,
value,
selector.addPrecondition(key)
).forEach((item) => output.push(item));
}
output.push([key, styles[key], selector.addScope(key)]);
});
return output;
}
function iterateStyles(sheet, styles, selector) {
const output = /* @__PURE__ */ new Set();
forIn(styles, (property, value) => {
let res = [];
if (isStyleCondition(property)) {
res = iterateStyles(
sheet,
value,
selector.addPostcondition(property)
);
} else if (isDirectClass(property)) {
res = asArray(value);
} else if (isMediaQuery(property)) {
res = handleMediaQuery(sheet, value, property, selector);
} else if (isCssVariables(property)) {
res = cssVariablesBlock(sheet, value, selector);
} else if (isValidProperty(property, value)) {
const rule = selector.createRule(property, value);
sheet.addRule(rule);
output.add(rule.hash);
}
return addEachClass(res, output);
});
return output;
}
function addEachClass(list, to) {
list.forEach((className) => to.add(className));
return to;
}
function cssVariablesBlock(sheet, styles, selector) {
const classes = /* @__PURE__ */ new Set();
const chunkRows = [];
forIn(styles, (property, value) => {
if (isValidProperty(property, value)) {
chunkRows.push(Rule.genRule(property, value));
return;
}
const res = iterateStyles(sheet, value ?? {}, selector);
addEachClass(res, classes);
});
if (!selector.scopeClassName) {
return classes;
}
if (chunkRows.length) {
const output = chunkRows.join(" ");
sheet.append(
`${mergeSelectors(selector.preconditions, {
right: selector.scopeClassName
})} {${output}}`
);
}
classes.add(selector.scopeClassName);
return classes;
}
function handleMediaQuery(sheet, styles, mediaQuery, selector) {
sheet.append(mediaQuery + " {");
const output = iterateStyles(sheet, styles, selector);
sheet.append("}");
return output;
}
function _arrayLikeToArray$1(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _createForOfIteratorHelperLoose(r, e) {
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (t) return (t = t.call(r)).next.bind(t);
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) {
t && (r = t);
var o = 0;
return function () {
return o >= r.length ? {
done: true
} : {
done: false,
value: r[o++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _extends$1() {
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends$1.apply(null, arguments);
}
function _inheritsLoose(t, o) {
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
}
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
function _unsupportedIterableToArray$1(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
}
}
var ClassNames;
(function (ClassNames) {
ClassNames["hiddenOnSearch"] = "epr-hidden-on-search";
ClassNames["searchActive"] = "epr-search-active";
ClassNames["hidden"] = "epr-hidden";
ClassNames["visible"] = "epr-visible";
ClassNames["active"] = "epr-active";
ClassNames["emoji"] = "epr-emoji";
ClassNames["category"] = "epr-emoji-category";
ClassNames["label"] = "epr-emoji-category-label";
ClassNames["categoryContent"] = "epr-emoji-category-content";
ClassNames["emojiHasVariations"] = "epr-emoji-has-variations";
ClassNames["scrollBody"] = "epr-body";
ClassNames["emojiList"] = "epr-emoji-list";
ClassNames["external"] = "__EmojiPicker__";
ClassNames["emojiPicker"] = "EmojiPickerReact";
ClassNames["open"] = "epr-open";
ClassNames["vertical"] = "epr-vertical";
ClassNames["horizontal"] = "epr-horizontal";
ClassNames["variationPicker"] = "epr-emoji-variation-picker";
ClassNames["darkTheme"] = "epr-dark-theme";
ClassNames["autoTheme"] = "epr-auto-theme";
})(ClassNames || (ClassNames = {}));
function asSelectors() {
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
classNames[_key] = arguments[_key];
}
return classNames.map(function (c) {
return "." + c;
}).join('');
}
var stylesheet = /*#__PURE__*/createSheet('epr', null);
var hidden = {
display: 'none',
opacity: '0',
pointerEvents: 'none',
visibility: 'hidden',
overflow: 'hidden'
};
var commonStyles = /*#__PURE__*/stylesheet.create({
hidden: /*#__PURE__*/_extends$1({
'.': ClassNames.hidden
}, hidden)
});
var PickerStyleTag = /*#__PURE__*/React__default.memo(function PickerStyleTag() {
return React__default.createElement("style", {
suppressHydrationWarning: true,
dangerouslySetInnerHTML: {
__html: stylesheet.getStyle()
}
});
});
var commonInteractionStyles = /*#__PURE__*/stylesheet.create({
'.epr-main': {
':has(input:not(:placeholder-shown))': {
categoryBtn: {
':hover': {
opacity: '1',
backgroundPositionY: 'var(--epr-category-navigation-button-size)'
}
},
hiddenOnSearch: /*#__PURE__*/_extends$1({
'.': ClassNames.hiddenOnSearch
}, hidden)
},
':has(input:placeholder-shown)': {
visibleOnSearchOnly: hidden
}
},
hiddenOnReactions: {
transition: 'all 0.5s ease-in-out'
},
'.epr-reactions': {
hiddenOnReactions: {
height: '0px',
width: '0px',
opacity: '0',
pointerEvents: 'none',
overflow: 'hidden'
}
},
'.EmojiPickerReact:not(.epr-search-active)': {
categoryBtn: {
':hover': {
opacity: '1',
backgroundPositionY: 'var(--epr-category-navigation-button-size)'
},
'&.epr-active': {
opacity: '1',
backgroundPositionY: 'var(--epr-category-navigation-button-size)'
}
},
visibleOnSearchOnly: /*#__PURE__*/_extends$1({
'.': 'epr-visible-on-search-only'
}, hidden)
}
});
function darkMode(key, value) {
var _eprDarkTheme, _eprAutoTheme;
return {
'.epr-dark-theme': (_eprDarkTheme = {}, _eprDarkTheme[key] = value, _eprDarkTheme),
'.epr-auto-theme': (_eprAutoTheme = {}, _eprAutoTheme[key] = {
'@media (prefers-color-scheme: dark)': value
}, _eprAutoTheme)
};
}
// eslint-disable-next-line complexity
function compareConfig(prev, next) {
var _prev$customEmojis, _next$customEmojis;
var prevCustomEmojis = (_prev$customEmojis = prev.customEmojis) != null ? _prev$customEmojis : [];
var nextCustomEmojis = (_next$customEmojis = next.customEmojis) != null ? _next$customEmojis : [];
return prev.open === next.open && prev.emojiVersion === next.emojiVersion && prev.reactionsDefaultOpen === next.reactionsDefaultOpen && prev.searchPlaceHolder === next.searchPlaceHolder && prev.searchPlaceholder === next.searchPlaceholder && prev.searchClearButtonLabel === next.searchClearButtonLabel && prev.defaultSkinTone === next.defaultSkinTone && prev.skinTonesDisabled === next.skinTonesDisabled && prev.autoFocusSearch === next.autoFocusSearch && prev.emojiStyle === next.emojiStyle && prev.theme === next.theme && prev.suggestedEmojisMode === next.suggestedEmojisMode && prev.lazyLoadEmojis === next.lazyLoadEmojis && prev.className === next.className && prev.height === next.height && prev.width === next.width && prev.style === next.style && prev.searchDisabled === next.searchDisabled && prev.skinTonePickerLocation === next.skinTonePickerLocation && prevCustomEmojis.length === nextCustomEmojis.length && prev.emojiData === next.emojiData;
}
var DEFAULT_REACTIONS = ['1f44d', '2764-fe0f', '1f603', '1f622', '1f64f', '1f44e', '1f621'];
var SuggestionMode;
(function (SuggestionMode) {
SuggestionMode["RECENT"] = "recent";
SuggestionMode["FREQUENT"] = "frequent";
})(SuggestionMode || (SuggestionMode = {}));
var EmojiStyle;
(function (EmojiStyle) {
EmojiStyle["NATIVE"] = "native";
EmojiStyle["APPLE"] = "apple";
EmojiStyle["TWITTER"] = "twitter";
EmojiStyle["GOOGLE"] = "google";
EmojiStyle["FACEBOOK"] = "facebook";
})(EmojiStyle || (EmojiStyle = {}));
var Theme;
(function (Theme) {
Theme["DARK"] = "dark";
Theme["LIGHT"] = "light";
Theme["AUTO"] = "auto";
})(Theme || (Theme = {}));
var SkinTones;
(function (SkinTones) {
SkinTones["NEUTRAL"] = "neutral";
SkinTones["LIGHT"] = "1f3fb";
SkinTones["MEDIUM_LIGHT"] = "1f3fc";
SkinTones["MEDIUM"] = "1f3fd";
SkinTones["MEDIUM_DARK"] = "1f3fe";
SkinTones["DARK"] = "1f3ff";
})(SkinTones || (SkinTones = {}));
var Categories;
(function (Categories) {
Categories["SUGGESTED"] = "suggested";
Categories["CUSTOM"] = "custom";
Categories["SMILEYS_PEOPLE"] = "smileys_people";
Categories["ANIMALS_NATURE"] = "animals_nature";
Categories["FOOD_DRINK"] = "food_drink";
Categories["TRAVEL_PLACES"] = "travel_places";
Categories["ACTIVITIES"] = "activities";
Categories["OBJECTS"] = "objects";
Categories["SYMBOLS"] = "symbols";
Categories["FLAGS"] = "flags";
})(Categories || (Categories = {}));
var SkinTonePickerLocation;
(function (SkinTonePickerLocation) {
SkinTonePickerLocation["SEARCH"] = "SEARCH";
SkinTonePickerLocation["PREVIEW"] = "PREVIEW";
})(SkinTonePickerLocation || (SkinTonePickerLocation = {}));
var CDN_URL_APPLE = 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/';
var CDN_URL_FACEBOOK = 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook/img/facebook/64/';
var CDN_URL_TWITTER = 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter/img/twitter/64/';
var CDN_URL_GOOGLE = 'https://cdn.jsdelivr.net/npm/emoji-datasource-google/img/google/64/';
function cdnUrl(emojiStyle) {
switch (emojiStyle) {
case EmojiStyle.TWITTER:
return CDN_URL_TWITTER;
case EmojiStyle.GOOGLE:
return CDN_URL_GOOGLE;
case EmojiStyle.FACEBOOK:
return CDN_URL_FACEBOOK;
case EmojiStyle.APPLE:
default:
return CDN_URL_APPLE;
}
}
var skinToneVariations = [SkinTones.NEUTRAL, SkinTones.LIGHT, SkinTones.MEDIUM_LIGHT, SkinTones.MEDIUM, SkinTones.MEDIUM_DARK, SkinTones.DARK];
var skinTonesNamed = /*#__PURE__*/Object.entries(SkinTones).reduce(function (acc, _ref) {
var key = _ref[0],
value = _ref[1];
acc[value] = key;
return acc;
}, {});
var skinTonesMapped = /*#__PURE__*/skinToneVariations.reduce(function (mapped, skinTone) {
var _Object$assign;
return Object.assign(mapped, (_Object$assign = {}, _Object$assign[skinTone] = skinTone, _Object$assign));
}, {});
var EmojiProperties;
(function (EmojiProperties) {
EmojiProperties["name"] = "n";
EmojiProperties["unified"] = "u";
EmojiProperties["variations"] = "v";
EmojiProperties["added_in"] = "a";
EmojiProperties["imgUrl"] = "imgUrl";
})(EmojiProperties || (EmojiProperties = {}));
function emojiNames(emoji) {
var _emoji$EmojiPropertie;
return (_emoji$EmojiPropertie = emoji[EmojiProperties.name]) != null ? _emoji$EmojiPropertie : [];
}
function addedIn(emoji) {
return parseFloat(emoji[EmojiProperties.added_in] || '0');
}
function emojiName(emoji) {
if (!emoji) {
return '';
}
var names = emojiNames(emoji);
return names[names.length - 1];
}
function unifiedWithoutSkinTone(unified) {
var splat = unified.split('-');
var _splat$splice = splat.splice(1, 1),
skinTone = _splat$splice[0];
if (skinTonesMapped[skinTone]) {
return splat.join('-');
}
return unified;
}
function emojiUnified(emoji, skinTone) {
var _emojiVariationUnifie;
var unified = emoji[EmojiProperties.unified];
if (!skinTone || !emojiHasVariations(emoji)) {
return unified;
}
return (_emojiVariationUnifie = emojiVariationUnified(emoji, skinTone)) != null ? _emojiVariationUnifie : unified;
}
function emojiUrlByUnified(unified, emojiStyle) {
return "" + cdnUrl(emojiStyle) + unified + ".png";
}
function emojiVariations(emoji) {
var _emoji$EmojiPropertie2;
return (_emoji$EmojiPropertie2 = emoji[EmojiProperties.variations]) != null ? _emoji$EmojiPropertie2 : [];
}
function emojiHasVariations(emoji) {
return emojiVariations(emoji).length > 0;
}
function emojiVariationUnified(emoji, skinTone) {
return skinTone ? emojiVariations(emoji).find(function (variation) {
return variation.includes(skinTone);
}) : emojiUnified(emoji);
}
function activeVariationFromUnified(unified) {
var _unified$split = unified.split('-'),
suspectedSkinTone = _unified$split[1];
return Object.keys(skinTonesMapped).includes(suspectedSkinTone) ? suspectedSkinTone : null;
}
var _configByCategory;
var categoriesOrdered = [Categories.SUGGESTED, Categories.CUSTOM, Categories.SMILEYS_PEOPLE, Categories.ANIMALS_NATURE, Categories.FOOD_DRINK, Categories.TRAVEL_PLACES, Categories.ACTIVITIES, Categories.OBJECTS, Categories.SYMBOLS, Categories.FLAGS];
var SuggestedRecent = {
name: 'Recently Used',
category: Categories.SUGGESTED
};
var configByCategory = (_configByCategory = {}, _configByCategory[Categories.SUGGESTED] = {
category: Categories.SUGGESTED,
name: 'Frequently Used'
}, _configByCategory[Categories.CUSTOM] = {
category: Categories.CUSTOM,
name: 'Custom Emojis'
}, _configByCategory[Categories.SMILEYS_PEOPLE] = {
category: Categories.SMILEYS_PEOPLE,
name: 'Smileys & People'
}, _configByCategory[Categories.ANIMALS_NATURE] = {
category: Categories.ANIMALS_NATURE,
name: 'Animals & Nature'
}, _configByCategory[Categories.FOOD_DRINK] = {
category: Categories.FOOD_DRINK,
name: 'Food & Drink'
}, _configByCategory[Categories.TRAVEL_PLACES] = {
category: Categories.TRAVEL_PLACES,
name: 'Travel & Places'
}, _configByCategory[Categories.ACTIVITIES] = {
category: Categories.ACTIVITIES,
name: 'Activities'
}, _configByCategory[Categories.OBJECTS] = {
category: Categories.OBJECTS,
name: 'Objects'
}, _configByCategory[Categories.SYMBOLS] = {
category: Categories.SYMBOLS,
name: 'Symbols'
}, _configByCategory[Categories.FLAGS] = {
category: Categories.FLAGS,
name: 'Flags'
}, _configByCategory);
function baseCategoriesConfig(modifiers) {
return categoriesOrdered.map(function (category) {
return _extends$1({}, configByCategory[category], modifiers && modifiers[category] && modifiers[category]);
});
}
function categoryFromCategoryConfig(category) {
return category.category;
}
function categoryNameFromCategoryConfig(category) {
return category.name;
}
function mergeCategoriesConfig(userCategoriesConfig, modifiers, emojiData) {
var _userCategoriesConfig;
if (userCategoriesConfig === void 0) {
userCategoriesConfig = [];
}
if (modifiers === void 0) {
modifiers = {};
}
var extra = function () {
// 1. Start with localized categories from emojiData
var fromData = emojiData != null && emojiData.categories ? Object.fromEntries(Object.entries(emojiData.categories).filter(function (_ref) {
var config = _ref[1];
return !!config;
})) : {};
// 2. Handle "Recently Used" override for explicit 'recent' mode
if (modifiers.suggestionMode === SuggestionMode.RECENT) {
var _emojiData$categories;
var recentConfig = emojiData == null ? void 0 : (_emojiData$categories = emojiData.categories) == null ? void 0 : _emojiData$categories['suggested_recent'];
fromData[Categories.SUGGESTED] = recentConfig ? {
category: Categories.SUGGESTED,
name: recentConfig.name
} : SuggestedRecent;
}
return fromData;
}();
var base = baseCategoriesConfig(extra);
if (!((_userCategoriesConfig = userCategoriesConfig) != null && _userCategoriesConfig.length)) {
return base;
}
return userCategoriesConfig.map(function (category) {
if (typeof category === 'string') {
return getBaseConfigByCategory(category, extra[category]);
}
return _extends$1({}, getBaseConfigByCategory(category.category, extra[category.category]), category);
});
}
function getBaseConfigByCategory(category, modifier) {
if (modifier === void 0) {
modifier = {};
}
return Object.assign(configByCategory[category], modifier);
}
var KNOWN_FAILING_EMOJIS = ['2640-fe0f', '2642-fe0f', '2695-fe0f'];
var DEFAULT_SEARCH_PLACEHOLDER = 'Search';
var DEFAULT_SEARCH_CLEAR_BUTTON_LABEL = 'Clear';
var SEARCH_RESULTS_NO_RESULTS_FOUND = 'No results found';
var SEARCH_RESULTS_SUFFIX = ' found. Use up and down arrow keys to navigate.';
var SEARCH_RESULTS_ONE_RESULT_FOUND = '1 result' + SEARCH_RESULTS_SUFFIX;
var SEARCH_RESULTS_MULTIPLE_RESULTS_FOUND = '%n results' + SEARCH_RESULTS_SUFFIX;
function mergeConfig(userConfig) {
var _userConfig$emojiData, _userConfig$emojiData2, _userConfig$emojiData3, _userConfig$previewCo, _userConfig$previewCo2;
if (userConfig === void 0) {
userConfig = {};
}
var base = basePickerConfig();
// Get localized mood from emojiData, fallback to base default
// Get localized mood from emojiData, fallback to base default
var localizedMood = (_userConfig$emojiData = userConfig.emojiData) == null ? void 0 : (_userConfig$emojiData2 = _userConfig$emojiData.categories) == null ? void 0 : (_userConfig$emojiData3 = _userConfig$emojiData2.preview_mood) == null ? void 0 : _userConfig$emojiData3.name;
var previewConfig = _extends$1({}, base.previewConfig, localizedMood && !((_userConfig$previewCo = userConfig.previewConfig) != null && _userConfig$previewCo.defaultCaption) ? {
defaultCaption: localizedMood
} : {}, (_userConfig$previewCo2 = userConfig.previewConfig) != null ? _userConfig$previewCo2 : {});
var config = Object.assign(base, userConfig);
var categories = mergeCategoriesConfig(userConfig.categories, {
suggestionMode: config.suggestedEmojisMode
}, userConfig.emojiData);
config.hiddenEmojis.forEach(function (emoji) {
config.unicodeToHide.add(emoji);
});
var skinTonePickerLocation = config.searchDisabled ? SkinTonePickerLocation.PREVIEW : config.skinTonePickerLocation;
return _extends$1({}, config, {
categories: categories,
previewConfig: previewConfig,
skinTonePickerLocation: skinTonePickerLocation
});
}
function basePickerConfig() {
return {
autoFocusSearch: true,
categories: baseCategoriesConfig(),
className: '',
customEmojis: [],
defaultSkinTone: SkinTones.NEUTRAL,
emojiStyle: EmojiStyle.APPLE,
emojiVersion: null,
getEmojiUrl: emojiUrlByUnified,
height: 450,
lazyLoadEmojis: false,
previewConfig: _extends$1({}, basePreviewConfig),
searchDisabled: false,
searchPlaceHolder: DEFAULT_SEARCH_PLACEHOLDER,
searchPlaceholder: DEFAULT_SEARCH_PLACEHOLDER,
searchClearButtonLabel: DEFAULT_SEARCH_CLEAR_BUTTON_LABEL,
skinTonePickerLocation: SkinTonePickerLocation.SEARCH,
skinTonesDisabled: false,
style: {},
suggestedEmojisMode: SuggestionMode.FREQUENT,
theme: Theme.LIGHT,
unicodeToHide: new Set(KNOWN_FAILING_EMOJIS),
width: 350,
reactionsDefaultOpen: false,
reactions: DEFAULT_REACTIONS,
open: true,
allowExpandReactions: true,
hiddenEmojis: [],
emojiData: undefined,
categoryIcons: {}
};
}
var basePreviewConfig = {
defaultEmoji: '1f60a',
defaultCaption: "What's your mood?",
showPreview: true
};
var _excluded = ["children"];
var ConfigContext = /*#__PURE__*/React__default.createContext(/*#__PURE__*/basePickerConfig());
function PickerConfigProvider(_ref) {
var children = _ref.children,
config = _objectWithoutPropertiesLoose(_ref, _excluded);
var mergedConfig = useSetConfig(config);
return React__default.createElement(ConfigContext.Provider, {
value: mergedConfig
}, children);
}
function useSetConfig(config) {
var _config$customEmojis;
var _React$useState = React__default.useState(function () {
return mergeConfig(config);
}),
mergedConfig = _React$useState[0],
setMergedConfig = _React$useState[1];
React__default.useEffect(function () {
if (compareConfig(mergedConfig, config)) {
return;
}
setMergedConfig(mergeConfig(config));
// not gonna...
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [(_config$customEmojis = config.customEmojis) == null ? void 0 : _config$customEmojis.length, config.open, config.emojiVersion, config.reactionsDefaultOpen, config.searchPlaceHolder, config.searchPlaceholder, config.searchClearButtonLabel, config.defaultSkinTone, config.skinTonesDisabled, config.autoFocusSearch, config.emojiStyle, config.theme, config.suggestedEmojisMode, config.lazyLoadEmojis, config.className, config.height, config.width, config.searchDisabled, config.skinTonePickerLocation, config.allowExpandReactions, config.emojiData]);
return mergedConfig;
}
function usePickerConfig() {
return React__default.useContext(ConfigContext);
}
function useDebouncedState(initialValue, delay) {
if (delay === void 0) {
delay = 0;
}
var _useState = React__default.useState(initialValue),
state = _useState[0],
setState = _useState[1];
var timer = React__default.useRef(null);
function debouncedSetState(value) {
return new Promise(function (resolve) {
var _window;
if (timer.current) {
clearTimeout(timer.current);
}
timer.current = (_window = window) == null ? void 0 : _window.setTimeout(function () {
setState(value);
resolve(value);
}, delay);
});
}
return [state, debouncedSetState];
}
var categories = {
smileys_people: {
category: "smileys_people",
name: "people & body"
},
animals_nature: {
category: "animals_nature",
name: "animals & nature"
},
food_drink: {
category: "food_drink",
name: "food & drink"
},
travel_places: {
category: "travel_places",
name: "travel & places"
},
activities: {
category: "activities",
name: "activities"
},
objects: {
category: "objects",
name: "objects"
},
symbols: {
category: "symbols",
name: "symbols"
},
flags: {
category: "flags",
name: "flags"
},
suggested: {
category: "suggested",
name: "Frequently Used"
},
custom: {
category: "custom",
name: "Custom Emojis"
},
suggested_recent: {
category: "suggested",
name: "Recently Used"
},
preview_mood: {
category: "preview_mood",
name: "What's your mood?"
}
};
var emojis = {
custom: [
],
smileys_people: [
{
n: [
"face",
"grin",
"grinning face"
],
u: "1f600",
a: "1"
},
{
n: [
"face",
"open",
"mouth",
"smile",
"grinning face with big eyes"
],
u: "1f603",
a: "0.6"
},
{
n: [
"eye",
"face",
"open",
"mouth",
"smile",
"grinning face with smiling eyes"
],
u: "1f604",
a: "0.6"
},
{
n: [
"eye",
"face",
"grin",
"smile",
"beaming face with smiling eyes"
],
u: "1f601",
a: "0.6"
},
{
n: [
"face",
"laugh",
"mouth",
"smile",
"satisfied",
"grinning squinting face"
],
u: "1f606",
a: "0.6"
},
{
n: [
"cold",
"face",
"open",
"smile",
"sweat",
"grinning face with sweat"
],
u: "1f605",
a: "0.6"
},
{
n: [
"face",
"rofl",
"floor",
"laugh",
"rotfl",
"rolling",
"rolling on the floor laughing"
],
u: "1f923",
a: "3"
},
{
n: [
"joy",
"face",
"tear",
"laugh",
"face with tears of joy"
],
u: "1f602",
a: "0.6"
},
{
n: [
"face",
"smile",
"slightly smiling face"
],
u: "1f642",
a: "1"
},
{
n: [
"face",
"upside down",
"upside down face"
],
u: "1f643",
a: "1"
},
{
n: [
"melt",
"liquid",
"dissolve",
"disappear",
"melting face"
],
u: "1fae0",
a: "14"
},
{
n: [
"face",
"wink",
"winking face"
],
u: "1f609",
a: "0.6"
},
{
n: [
"eye",
"face",
"blush",
"smile",
"smiling face with smiling eyes"
],
u: "1f60a",
a: "0.6"
},
{
n: [
"face",
"halo",
"angel",
"fantasy",
"innocent",
"smiling face with halo"
],
u: "1f607",
a: "1"
},
{
n: [
"adore",
"crush",
"hearts",
"in love",
"smiling face with hearts"
],
u: "1f970",
a: "11"
},
{
n: [
"eye",
"face",
"love",
"smile",
"smiling face with heart eyes"
],
u: "1f60d",
a: "0.6"
},
{
n: [
"eyes",
"face",
"star",
"grinning",
"star struck"
],
u: "1f929",
a: "5"
},
{
n: [
"face",
"kiss",
"face blowing a kiss"
],
u: "1f618",
a: "0.6"
},
{
n: [
"face",
"kiss",
"kissing face"
],
u: "1f617",
a: "1"
},
{
n: [
"face",
"smile",
"relaxed",
"outlined",
"smiling face"
],
u: "263a-fe0f",
a: "0.6"
},
{
n: [
"eye",
"face",
"kiss",
"closed",
"kissing face with closed eyes"
],
u: "1f61a",
a: "0.6"
},
{
n: [
"eye",
"face",
"kiss",
"smile",
"kissing face with smiling eyes"
],
u: "1f619",
a: "1"
},
{
n: [
"tear",
"proud",
"smiling",
"touched",
"grateful",
"relieved",
"smiling face with tear"
],
u: "1f972",
a: "13"
},
{
n: [
"yum",
"face",
"smile",
"delicious",
"savouring",
"face savoring food"
],
u: "1f60b",
a: "0.6"
},
{
n: [
"face",
"tongue",
"face with tongue"
],
u: "1f61b",
a: "1"
},
{
n: [
"eye",
"face",
"joke",
"wink",
"tongue",
"winking face with tongue"
],
u: "1f61c",
a: "0.6"
},
{
n: [
"eye",
"goofy",
"large",
"small",
"zany face"
],
u: "1f92a",
a: "5"
},
{
n: [
"eye",
"face",
"taste",
"tongue",
"horrible",
"squinting face with tongue"
],
u: "1f61d",
a: "0.6"
},
{
n: [
"face",
"money",
"mouth",
"money mouth face"
],
u: "1f911",
a: "1"
},
{
n: [
"hug",
"face",
"hugging",
"open hands",
"smiling face",
"smiling face with open hands"
],
u: "1f917",
a: "1"
},
{
n: [
"whoops",
"face with hand over mouth"
],
u: "1f92d",
a: "5"
},
{
n: [
"awe",
"scared",
"surprise",
"amazement",
"disbelief",
"embarrass",
"face with open eyes and hand over mouth"
],
u: "1fae2",
a: "14"
},
{
n: [
"peep",
"stare",
"captivated",
"face with peeking eye"
],
u: "1fae3",
a: "14"
},
{
n: [
"quiet",
"shush",
"shushing face"
],
u: "1f92b",
a: "5"
},
{
n: [
"face",
"thinking",
"thinking face"
],
u: "1f914",
a: "1"
},
{
n: [
"ok",
"yes",
"sunny",
"salute",
"troops",
"saluting face"
],
u: "1fae1",
a: "14"
},
{
n: [
"zip",
"face",
"mouth",
"zipper",
"zipper mouth face"
],
u: "1f910",
a: "1"
},
{
n: [
"skeptic",
"distrust",
"face with raised eyebrow"
],
u: "1f928",
a: "5"
},
{
n: [
"meh",
"face",
"deadpan",
"neutral",
"neutral face"
],
u: "1f610",
a: "0.7"
},
{
n: [
"meh",
"face",
"inexpressive",
"unexpressive",
"expressionless",
"expressionless face"
],
u: "1f611",
a: "1"
},
{
n: [
"face",
"mouth",
"quiet",
"silent",
"face without mouth"
],
u: "1f636",
a: "1"
},
{
n: [
"hide",
"depressed",
"disappear",
"introvert",
"invisible",
"dotted line face"
],
u: "1fae5",
a: "14"
},
{
n: [
"absentminded",
"face in clouds",
"head in clouds",
"face in the fog"
],
u: "1f636-200d-1f32b-fe0f",
a: "13.1"
},
{
n: [
"face",
"smirk",
"smirking face"
],
u: "1f60f",
a: "0.6"
},
{
n: [
"face",
"unhappy",
"unamused",
"unamused face"
],
u: "1f612",
a: "0.6"
},
{
n: [
"eyes",
"face",
"eyeroll",
"rolling",
"face with rolling eyes"
],
u: "1f644",
a: "1"
},
{
n: [
"face",
"grimace",
"grimacing face"
],
u: "1f62c",
a: "1"
},
{
n: [
"gasp",
"groan",
"exhale",
"relief",
"whisper",
"whistle",
"face exhaling"
],
u: "1f62e-200d-1f4a8",
a: "13.1"
},
{
n: [
"lie",
"face",
"pinocchio",
"lying face"
],
u: "1f925",
a: "3"
},
{
n: [
"face",
"shock",
"shaking",
"vibrate",
"earthquake",
"shaking face"
],
u: "1fae8",
a: "15"
},
{
n: [
"no",
"shake",
"head shaking horizontally"
],
u: "1f642-200d-2194-fe0f",
a: "15.1"
},
{
n: [
"nod",
"yes",
"head shaking vertically"
],
u: "1f642-200d-2195-fe0f",
a: "15.1"
},
{
n: [
"face",
"relieved",
"relieved face"
],
u: "1f60c",
a: "0.6"
},
{
n: [
"face",
"pensive",
"dejected",
"pensive face"
],
u: "1f614",
a: "0.6"
},
{
n: [
"face",
"sleep",
"good night",
"sleepy face"
],
u: "1f62a",
a: "0.6"
},
{
n: [
"face",
"drooling",
"drooling face"
],
u: "1f924",
a: "3"
},
{
n: [
"zzz",
"face",
"sleep",
"good night",
"sleeping face"
],
u: "1f634",
a: "1"
},
{
n: [
"cold",
"face",
"mask",
"sick",
"doctor",
"face with medical mask"
],
u: "1f637",
a: "0.6"
},
{
n: [
"ill",
"face",
"sick",
"thermometer",
"face with thermometer"
],
u: "1f912",
a: "1"
},
{
n: [
"face",
"hurt",
"injury",
"bandage",
"face with head bandage"
],
u: "1f915",
a: "1"
},
{
n: [
"face",
"vomit",
"nauseated",
"nauseated face"
],
u: "1f922",
a: "3"
},
{
n: [
"puke",
"sick",
"vomit",
"face vomiting"
],
u: "1f92e",
a: "5"
},
{
n: [
"face",
"sneeze",
"gesundheit",
"sneezing face"
],
u: "1f927",
a: "3"
},
{
n: [
"hot",
"hot face",
"feverish",
"sweating",
"red faced",
"heat stroke"
],
u: "1f975",
a: "11"
},
{
n: [
"cold",
"icicles",
"freezing",
"cold face",
"frostbite",
"blue faced"
],
u: "1f976",
a: "11"
},
{
n: [
"dizzy",
"tipsy",
"woozy face",
"wavy mouth",
"intoxicated",
"uneven eyes"
],
u: "1f974",
a: "11"
},
{
n: [
"dead",
"face",
"knocked out",
"crossed out eyes",
"face with crossed out eyes"
],
u: "1f635",
a: "0.6"
},
{
n: [
"whoa",
"dizzy",
"spiral",
"trouble",
"hypnotized",
"face with spiral eyes"
],
u: "1f635-200d-1f4ab",
a: "13.1"
},
{
n: [
"shocked",
"mind blown",
"exploding head"
],
u: "1f92f",
a: "5"
},
{
n: [
"hat",
"face",
"cowboy",
"cowgirl",
"cowboy hat face"
],
u: "1f920",
a: "3"
},
{
n: [
"hat",
"horn",
"party",
"celebration",
"partying face"
],
u: "1f973",
a: "11"
},
{
n: [
"face",
"nose",
"glasses",
"disguise",
"incognito",
"disguised face"
],
u: "1f978",
a: "13"
},
{
n: [
"sun",
"cool",
"face",
"bright",
"sunglasses",
"smiling face with sunglasses"
],
u: "1f60e",
a: "1"
},
{
n: [
"face",
"geek",
"nerd",
"nerd face"
],
u: "1f913",
a: "1"
},
{
n: [
"face",
"stuffy",
"monocle",
"face with monocle"
],
u: "1f9d0",
a: "5"
},
{
n: [
"meh",
"face",
"confused",
"confused face"
],
u: "1f615",
a: "1"
},
{
n: [
"meh",
"unsure",
"skeptical",
"disappointed",
"face with diagonal mouth"
],
u: "1fae4",
a: "14"
},
{
n: [
"face",
"worried",
"worried face"
],
u: "1f61f",
a: "1"
},
{
n: [
"face",
"frown",
"slightly frowning face"
],
u: "1f641",
a: "1"
},
{
n: [
"face",
"frown",
"frowning face"
],
u: "2639-fe0f",
a: "0.7"
},
{
n: [
"face",
"open",
"mouth",
"sympathy",
"face with open mouth"
],
u: "1f62e",
a: "1"
},
{
n: [
"face",
"hushed",
"stunned",
"surprised",
"hushed face"
],
u: "1f62f",
a: "1"
},
{
n: [
"face",
"shocked",
"totally",
"astonished",
"astonished face"
],
u: "1f632",
a: "0.6"
},
{
n: [
"face",
"dazed",
"flushed",
"flushed face"
],
u: "1f633",
a: "0.6"
},
{
n: [
"mercy",
"begging",
"puppy eyes",
"pleading face"
],
u: "1f97a",
a: "11"
},
{
n: [
"cry",
"sad",
"angry",
"proud",
"resist",
"face holding back tears"
],
u: "1f979",
a: "14"
},
{
n: [
"face",
"open",
"frown",
"mouth",
"frowning face with open mouth"
],
u: "1f626",
a: "1"
},
{
n: [
"face",
"anguished",
"anguished face"
],
u: "1f627",
a: "1"
},
{
n: [
"face",
"fear",
"scared",
"fearful",
"fearful face"
],
u: "1f628",
a: "0.6"
},
{
n: [
"blue",
"cold",
"face",
"sweat",
"rushed",
"anxious face with sweat"
],
u: "1f630",
a: "0.6"
},
{
n: [
"face",
"whew",
"relieved",
"disappointed",
"sad but relieved face"
],
u: "1f625",
a: "0.6"
},
{
n: [
"cry",
"sad",
"face",
"tear",
"crying face"
],
u: "1f622",
a: "0.6"
},
{
n: [
"cry",
"sad",
"sob",
"face",
"tear",
"loudly crying face"
],
u: "1f62d",
a: "0.6"
},
{
n: [
"face",
"fear",
"munch",
"scared",
"scream",
"face screaming in fear"
],
u: "1f631",
a: "0.6"
},
{
n: [
"face",
"confounded",
"confounded face"
],
u: "1f616",
a: "0.6"
},
{
n: [
"face",
"persevere",
"persevering face"
],
u: "1f623",
a: "0.6"
},
{
n: [
"face",
"disappointed",
"disappointed face"
],
u: "1f61e",
a: "0.6"
},
{
n: [
"cold",
"face",
"sweat",
"downcast face with sweat"
],
u: "1f613",
a: "0.6"
},
{
n: [
"face",
"tired",
"weary",
"weary face"
],
u: "1f629",
a: "0.6"
},
{
n: [
"face",
"tired",
"tired face"
],
u: "1f62b",
a: "0.6"
},
{
n: [
"yawn",
"bored",
"tired",
"yawning face"
],
u: "1f971",
a: "12"
},
{
n: [
"won",
"face",
"triumph",
"face with steam from nose"
],
u: "1f624",
a: "0.6"
},
{
n: [
"mad",
"red",
"face",
"rage",
"angry",
"enraged",
"pouting",
"enraged face"
],
u: "1f621",
a: "0.6"
},
{
n: [
"mad",
"face",
"anger",
"angry",
"angry face"
],
u: "1f620",
a: "0.6"
},
{
n: [
"swearing",
"face with symbols on mouth"
],
u: "1f92c",
a: "5"
},
{
n: [
"face",
"horns",
"smile",
"fantasy",
"fairy tale",
"smiling face with horns"
],
u: "1f608",
a: "1"
},
{
n: [
"imp",
"face",
"demon",
"devil",
"fantasy",
"angry face with horns"
],
u: "1f47f",
a: "0.6"
},
{
n: [
"face",
"skull",
"death",
"monster",
"fairy tale"
],
u: "1f480",
a: "0.6"
},
{
n: [
"face",
"death",
"skull",
"monster",
"crossbones",
"skull and crossbones"
],
u: "2620-fe0f",
a: "1"
},
{
n: [
"poo",
"dung",
"face",
"poop",
"monster",
"pile of poo"
],
u: "1f4a9",
a: "0.6"
},
{
n: [
"face",
"clown",
"clown face"
],