Files
openwhispr/scripts/sync-emoji-data.js
Gabriel Stein a7f22e07c3 feat(notes): space settings modal, in-app emoji picker, membership UI cleanup (#2186)
* feat(notes): space settings modal, in-app emoji picker, membership UI cleanup

- Replace the OS emoji panel with a searchable, categorised, virtualised
  in-app picker (emojibase data per locale, emoji-version probe, recents)
- Add a Space settings modal (General | Members) behind a single Settings
  menu item; name and emoji save in place, members can leave, admins
  delete through the existing type-the-name confirm
- Merge role and remove into one quiet menu per roster row and collapse
  the add-people list until focused
- Onboarding: an existing macOS Screen Recording grant now counts as the
  screen-context opt-in; the setup card shows all four local model marks
- Remove the show-emoji-panel IPC path and the inline space rename

* fix(notes): keep focus in the delete confirm and select the space name once per open
2026-09-13 19:38:10 -07:00

50 lines
1.7 KiB
JavaScript

#!/usr/bin/env node
// Generates the emoji picker datasets in src/data/emoji/ from emojibase-data (a
// devDependency): one file per app locale it covers, keeping only what the picker
// needs — the emoji, its localized label and search tags, its group, and the Emoji
// version that introduced it (so the picker can hide glyphs the OS can't render).
// Group names come from the app's own translations (emojiPicker.groups), not from
// emojibase, whose CLDR messages are wrong in several locales.
// Re-run after bumping emojibase-data: node scripts/sync-emoji-data.js
const fs = require("fs");
const path = require("path");
// App locale → emojibase locale. Locales absent here (ar) fall back to en at runtime.
const LOCALES = {
de: "de",
en: "en",
es: "es",
fr: "fr",
it: "it",
ja: "ja",
pt: "pt",
ru: "ru",
"zh-CN": "zh",
"zh-TW": "zh-hant",
};
// Skin-tone and hair modifiers: not pickable on their own.
const COMPONENT_GROUP = 2;
const OUT_DIR = path.join(__dirname, "..", "src", "data", "emoji");
fs.mkdirSync(OUT_DIR, { recursive: true });
for (const [appLocale, emojibaseLocale] of Object.entries(LOCALES)) {
const data = require(`emojibase-data/${emojibaseLocale}/data.json`);
const emoji = data
.filter((entry) => entry.group != null && entry.group !== COMPONENT_GROUP)
.sort((a, b) => a.order - b.order)
.map(({ emoji, label, group, version, tags }) => ({
emoji,
label,
group,
version,
...(tags?.length ? { tags } : {}),
}));
const file = path.join(OUT_DIR, `${appLocale}.json`);
fs.writeFileSync(file, `${JSON.stringify({ emoji })}\n`);
console.log(`${path.relative(process.cwd(), file)}: ${emoji.length} emoji`);
}