team-10/env/Lib/site-packages/streamlit/emojis.py

35 lines
79 KiB
Python
Raw Normal View History

2025-08-02 07:34:44 +02:00
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A generated list with all existing emojis.
DO NOT EDIT MANUALLY! The list in this file is generated by `scripts/update-emojis.py`.
This module gets lazy-loaded only when an emoji check is required (see string_util).
"""
import re
# fmt: off
### EMOJIS START ###
ALL_EMOJIS = {"#⃣", "#️⃣", "*⃣", "*️⃣", "0⃣", "0", "1⃣", "1", "2⃣", "2", "3⃣", "3", "4⃣", "4", "5⃣", "5", "6⃣", "6", "7⃣", "7", "8⃣", "8", "9⃣", "9", "©", "©️", "®", "®️", "", "‼️", "", "⁉️", "", "™️", "", "", "", "↔️", "", "↕️", "", "↖️", "", "↗️", "", "↘️", "", "↙️", "", "↩️", "", "↪️", "", "", "", "⌨️", "", "⏏️", "", "", "", "", "", "⏭️", "", "⏮️", "", "⏯️", "", "", "⏱️", "", "⏲️", "", "", "⏸️", "", "⏹️", "", "⏺️", "", "Ⓜ️", "", "▪️", "", "▫️", "", "▶️", "", "◀️", "", "◻️", "", "◼️", "", "", "", "☀️", "", "☁️", "", "☂️", "", "☃️", "", "☄️", "", "☎️", "", "☑️", "", "", "", "☘️", "", "☝️", "☝🏻", "☝🏼", "☝🏽", "☝🏾", "☝🏿", "", "☠️", "", "☢️", "", "☣️", "", "☦️", "", "☪️", "", "☮️", "", "☯️", "", "☸️", "", "☹️", "", "☺️", "", "♀️", "", "♂️", "", "", "", "", "", "", "", "", "", "", "", "", "", "♟️", "", "♠️", "", "♣️", "", "♥️", "", "♦️", "", "♨️", "", "♻️", "", "♾️", "", "", "⚒️", "", "", "⚔️", "", "⚕️", "", "⚖️", "", "⚗️", "", "⚙️", "", "⚛️", "", "⚜️", "", "⚠️", "", "", "⚧️", "", "", "", "⚰️", "", "⚱️", "", "", "", "", "", "⛈️", "", "", "⛏️", "", "⛑️", "", "⛓‍💥", "⛓️", "⛓️‍💥", "", "", "⛩️", "", "", "⛰️", "", "⛱️", "", "", "", "⛴️", "", "", "⛷️", "", "⛸️", "", "⛹‍♀", "⛹‍♀️", "⛹‍♂", "⛹‍♂️", "⛹️", "⛹️‍♀", "⛹️‍♀️", "⛹️‍♂", "⛹️‍♂️", "⛹🏻", "⛹🏻‍♀", "⛹🏻‍♀️", "⛹🏻‍♂", "⛹🏻‍♂️", "⛹🏼", "⛹🏼‍♀", "⛹🏼‍♀️", "⛹🏼‍♂", "⛹🏼‍♂️", "⛹🏽", "⛹🏽‍♀", "⛹🏽‍♀️", "⛹🏽‍♂", "⛹🏽‍♂️", "⛹🏾", "⛹🏾‍♀", "⛹🏾‍♀️", "⛹🏾‍♂", "⛹🏾‍♂️", "⛹🏿", "⛹🏿‍♀", "⛹🏿‍♀️", "⛹🏿‍♂", "⛹🏿‍♂️", "", "", "", "✂️", "", "", "✈️", "", "✉️", "", "✊🏻", "✊🏼", "✊🏽", "✊🏾", "✊🏿", "", "✋🏻", "✋🏼", "✋🏽", "✋🏾", "✋🏿", "", "✌️", "✌🏻", "✌🏼", "✌🏽", "✌🏾", "✌🏿", "", "✍️", "✍🏻", "✍🏼", "✍🏽", "✍🏾", "✍🏿", "", "✏️", "", "✒️", "", "✔️", "", "✖️", "", "✝️", "", "✡️", "", "", "✳️", "", "✴️", "", "❄️", "", "❇️", "", "", "", "", "", "", "", "❣️", "", "❤‍🔥", "❤‍🩹", "❤️", "❤️‍🔥", "❤️‍🩹", "", "", "", "", "➡️", "", "", "", "⤴️", "", "⤵️", "", "⬅️", "", "⬆️", "", "⬇️", "", "", "", "", "", "〰️", "", "〽️", "", "㊗️", "", "㊙️", "🀄", "🃏", "🅰", "🅰️", "🅱", "🅱️", "🅾", "🅾️", "🅿", "🅿️", "🆎", "🆑", "🆒", "🆓", "🆔", "🆕", "🆖", "🆗", "🆘", "🆙", "🆚", "🇦🇨", "🇦🇩", "🇦🇪", "🇦🇫", "🇦🇬", "🇦🇮", "🇦🇱", "🇦🇲", "🇦🇴", "🇦🇶", "🇦🇷", "🇦🇸", "🇦🇹", "🇦🇺", "🇦🇼", "🇦🇽", "🇦🇿", "🇧🇦", "🇧🇧", "🇧🇩", "🇧🇪", "🇧🇫", "🇧🇬", "🇧🇭", "🇧🇮", "🇧🇯", "🇧🇱", "🇧🇲", "🇧🇳", "🇧🇴", "🇧🇶", "🇧🇷", "🇧🇸", "🇧🇹", "🇧🇻", "🇧🇼", "🇧🇾", "🇧🇿", "🇨🇦"
### EMOJIS END ###
# The ESCAPED_EMOJI list is sorted in descending order to make that longer emoji appear
# first in the regex compiled below. This ensures that we grab the full emoji in a
# multi-character emoji sequence that starts with a shorter emoji (emoji are weird...).
ESCAPED_EMOJI = [re.escape(e) for e in sorted(ALL_EMOJIS, reverse=True)]
EMOJI_EXTRACTION_REGEX = re.compile(f"^({'|'.join(ESCAPED_EMOJI)})[_ -]*(.*)")