Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

4.9 KB
Raw Blame
/** Curated keyword index for the emoji catalog. Lets "heart" match "❤️"
 *  in search, which a naive `glyph.includes(query)` cannot do because
 *  the haystack is the literal codepoint, not a label.
 *
 *  Format: emoji → space-separated keyword string (pre-joined so the
 *  search hot path is one `includes()` per emoji, no array walking).
 *
 *  Not exhaustive — covers the catalog in `emoji-catalog.ts`. Add new
 *  keywords here when you add new emojis to the catalog. */

export const EMOJI_KEYWORDS: Record<string, string> = {
  // Smileys
  "😀": "grin happy smile",
  "😃": "grin smile happy",
  "😄": "smile happy joy laugh",
  "😁": "grin beam happy",
  "😆": "laugh squint happy",
  "😅": "sweat smile relief",
  "🤣": "rofl laugh roll floor",
  "😂": "joy laugh tears",
  "🙂": "smile slight",
  "🙃": "upside down smile",
  "😉": "wink",
  "😊": "blush smile happy",
  "😇": "halo angel innocent",
  "🥰": "love smile hearts",
  "😍": "love heart eyes",
  "🤩": "star struck wow",
  "😘": "kiss blow",
  "😗": "kiss",
  "☺️": "smile relax",
  "😚": "kiss closed eyes",
  "😙": "kiss smile",
  "🥲": "smile tear",
  "😋": "yum tongue",
  "😛": "tongue out",
  "😜": "tongue wink",
  "🤪": "zany crazy",
  "😝": "tongue squint",
  "🤑": "money mouth",
  "🤗": "hug",
  "🤭": "hand mouth oops",
  "🤫": "shush quiet",
  "🤔": "think",
  "🤐": "zipper mouth",
  "🤨": "raised brow",
  "😐": "neutral",
  "😑": "expressionless",
  "😶": "no mouth",
  "😏": "smirk",
  "😒": "unamused",
  "🙄": "eye roll",
  "😬": "grimace",
  "🤥": "lying nose",
  "😌": "relieved",
  "😔": "pensive sad",
  "😪": "sleepy",
  "🤤": "drool",
  "😴": "sleep zzz",
  "🤒": "sick thermometer",
  "🤕": "head bandage",
  "🤧": "sneeze",
  "🥵": "hot heat",
  "🥶": "cold freeze",
  "🥴": "woozy",
  "😵": "dizzy",
  "🤯": "explode mind blown",
  "🤠": "cowboy",
  "🥳": "party",
  "🥸": "disguise glasses",
  "😎": "cool sunglasses",
  "🤓": "nerd glasses",
  // Objects (the ones people search for most)
  "📄": "page document file",
  "📝": "memo note write",
  "📚": "books library",
  "📖": "book open read",
  "📓": "notebook",
  "📔": "notebook decorated",
  "📕": "book closed red",
  "📗": "book green",
  "📘": "book blue",
  "📙": "book orange",
  "📒": "ledger yellow",
  "📑": "tabs bookmark",
  "📰": "news paper",
  "🗞️": "newspaper",
  "🗒️": "spiral notepad",
  "🗓️": "spiral calendar",
  "📅": "calendar date",
  "📆": "tear off calendar",
  "🗂️": "card index dividers",
  "📂": "folder open",
  "📁": "folder",
  "🗃️": "card file box",
  "🗄️": "file cabinet",
  "📊": "chart bar",
  "📈": "chart up trend",
  "📉": "chart down",
  "📋": "clipboard",
  "🧾": "receipt",
  "🔖": "bookmark",
  "🏷️": "tag label",
  "💼": "briefcase work",
  "🎯": "target dart goal",
  "🧩": "puzzle",
  "🧠": "brain",
  "💡": "idea light bulb",
  "🔦": "flashlight",
  "🧪": "test tube science",
  "🧫": "petri dish",
  "🧬": "dna",
  "🔬": "microscope",
  "🔭": "telescope",
  "📡": "satellite antenna",
  "💻": "laptop computer",
  "🖥️": "desktop computer",
  "⌨️": "keyboard",
  "🖱️": "mouse",
  "🖨️": "printer",
  "📱": "phone mobile cell",
  "📺": "tv television",
  "🧰": "toolbox",
  "🛠️": "tools",
  "⚙️": "gear settings",
  "🔧": "wrench",
  "🔨": "hammer",
  "🔌": "plug",
  "🔋": "battery",
  "💎": "gem diamond",
  "💰": "money bag",
  // Nature
  "🌱": "seedling plant",
  "🌿": "herb leaves",
  "🍀": "clover luck four leaf",
  "🌴": "palm tree",
  "🌳": "tree",
  "🌲": "evergreen tree",
  "🌸": "cherry blossom flower",
  "🌷": "tulip flower",
  "🌹": "rose flower",
  "🌻": "sunflower",
  "🌞": "sun face",
  "🌙": "moon crescent",
  "⭐": "star",
  "🌟": "glowing star",
  "✨": "sparkles",
  "⚡": "lightning bolt zap",
  "🌈": "rainbow",
  "☀️": "sun sunny",
  "☁️": "cloud",
  "❄️": "snowflake winter cold",
  "🔥": "fire flame hot",
  "💧": "drop water",
  "🌊": "wave water ocean",
  // Symbols (search hot for these)
  "❤️": "heart love red",
  "🧡": "heart orange",
  "💛": "heart yellow",
  "💚": "heart green",
  "💙": "heart blue",
  "💜": "heart purple",
  "🖤": "heart black",
  "🤍": "heart white",
  "💔": "broken heart",
  "✅": "check mark done",
  "❌": "cross x error",
  "⭕": "circle o",
  "🚫": "no prohibited",
  "💯": "hundred 100",
  "⚠️": "warning",
  "❗": "exclamation",
  "❓": "question",
  "♻️": "recycle",
};

/** Build a single concat string for fast `.includes()` lookup. The string
 *  is `<glyph> <keywords>` so both glyph match and keyword match resolve
 *  in one scan. Lowercased once at module load. */
export function buildEmojiSearchHaystack(emoji: string): string {
  const kw = EMOJI_KEYWORDS[emoji] ?? "";
  return `${emoji} ${kw}`.toLowerCase();
}