owncast/webroot/js/web_modules/@joeattardi/emoji-button.js

18 lines
248 KiB
JavaScript
Raw Normal View History

/*! *****************************************************************************
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.
***************************************************************************** */
function e(e,o,n,i){return new(n||(n=Promise))((function(a,r){function t(e){try{m(i.next(e));}catch(e){r(e);}}function s(e){try{m(i.throw(e));}catch(e){r(e);}}function m(e){var o;e.done?a(e.value):(o=e.value,o instanceof n?o:new n((function(e){e(o);}))).then(t,s);}m((i=i.apply(e,o||[])).next());}))}!function(e,o){void 0===o&&(o={});var n=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e));}}('@keyframes show {\n 0% {\n opacity: 0;\n transform: scale3d(0.8, 0.8, 0.8);\n }\n\n 50% {\n transform: scale3d(1.05, 1.05, 1.05);\n }\n\n 100% {\n transform: scale3d(1, 1, 1);\n }\n}\n\n@keyframes hide {\n 0% {\n opacity: 1;\n transform: scale3d(1, 1, 1);\n }\n\n 100% {\n opacity: 0;\n transform: scale3d(0.8, 0.8, 0.8);\n }\n}\n\n@keyframes grow {\n 0% {\n opacity: 0;\n transform: scale3d(0.8, 0.8, 0.8); \n }\n\n 100% { \n opacity: 1;\n transform: scale3d(1, 1, 1); \n }\n}\n\n@keyframes shrink {\n 0% { \n opacity: 1;\n transform: scale3d(1, 1, 1);\n }\n\n 100% { \n opacity: 0;\n transform: scale3d(0.8, 0.8, 0.8); \n }\n}\n\n@keyframes fade-in {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n}\n\n@keyframes fade-out {\n 0% { opacity: 1; }\n 100% { opacity: 0; }\n}\n\n.emoji-picker {\n --animation-duration: 0.2s;\n --animation-easing: ease-in-out;\n\n --emoji-size: 1.8em;\n --emoji-size-multiplier: 1.5;\n --emoji-preview-size: 2em;\n --emoji-per-row: 8;\n --row-count: 6;\n\n --content-height: calc((var(--emoji-size) * var(--emoji-size-multiplier)) * var(--row-count) + var(--category-name-size) + var(--category-button-height) + 0.5em);\n\n --category-name-size: 0.85em;\n\n --category-button-height: 2em;\n --category-button-size: 1.1em;\n --category-border-bottom-size: 4px;\n\n --focus-indicator-color: #999999;\n\n --search-height: 2em;\n\n --blue-color: #4F81E5;\n\n --border-color: #CCCCCC;\n --background-color: #FFFFFF;\n --text-color: #000000;\n --secondary-text-color: #666666;\n --hover-color: #E8F4F9;\n --search-focus-border-color: var(--blue-color);\n --search-icon-color: #CCCCCC;\n --overlay-background-color: rgba(0, 0, 0, 0.8);\n --popup-background-color: #FFFFFF;\n --category-button-color: #666666;\n --category-button-active-color: var(--blue-color);\n\n --dark-border-color: #666666;\n --dark-background-color: #333333;\n --dark-text-color: #FFFFFF;\n --dark-secondary-text-color: #999999;\n --dark-hover-color: #666666;\n --dark-search-background-color: #666666;\n --dark-search-border-color: #999999;\n --dark-search-placeholder-color: #999999;\n --dark-search-focus-border-color: #DBE5F9;\n --dark-popup-background-color: #333333;\n --dark-category-button-color: #FFFFFF;\n\n --font: Arial, Helvetica, sans-serif;\n --font-size: 16px;\n}\n\n.emoji-picker {\n font-size: var(--font-size);\n border: 1px solid var(--border-color);\n border-radius: 5px;\n background: var(--background-color);\n width: calc(var(--emoji-per-row) * var(--emoji-size) * var(--emoji-size-multiplier) + 1em + 1.5rem);\n font-family: var(--font);\n overflow: hidden;\n animation: show var(--animation-duration) var(--animation-easing);\n}\n\n.emoji-picker * {\n font-family: var(--font);\n box-sizing: content-box;\n}\n\n.emoji-picker__overlay {\n background: rgba(0, 0, 0, 0.75);\n z-index: 1000;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.emoji-picker.hiding {\n animation: hide var(--animation-duration) var(--animation-easing);\n}\n\n.emoji-picker.dark {\n background: var(--dark-background-color);\n color: var(--dark-text-color);\n border-color: var(--dark-border-color);\n}\n\n.emoji-picker__content {\n padding: 0.5em;\n height: var(--content-height);\n position: relative;\n}\n\n.emoji-picker__preview {\n height: var(--emoji-preview-size);\n padding
export { rn as EmojiButton };