mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-07-12 15:36:32 +02:00
dc10a90851
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
window.EmojiUtils = {
|
|
splitEmojis(text) {
|
|
if (Intl.Segmenter) {
|
|
const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
|
return Array.from(segmenter.segment(text), ({ segment }) => segment);
|
|
}
|
|
return Array.from(text);
|
|
},
|
|
|
|
joinEmojis(emojis) {
|
|
return emojis.join('');
|
|
},
|
|
|
|
getAllEmojis() {
|
|
if (!window.emojiData || typeof window.emojiData !== 'object') {
|
|
return [];
|
|
}
|
|
return Object.keys(window.emojiData).filter(key => {
|
|
const value = window.emojiData[key];
|
|
return typeof value === 'object' && value !== null && 'official' in value;
|
|
});
|
|
},
|
|
|
|
async getCompatibleEmojis(progressCallback) {
|
|
const allEmojis = this.getAllEmojis();
|
|
|
|
if (window.emojiCompatibility && typeof window.emojiCompatibility.getCompatibleEmojis === 'function') {
|
|
return await window.emojiCompatibility.getCompatibleEmojis(allEmojis, progressCallback);
|
|
}
|
|
return allEmojis;
|
|
}
|
|
};
|
|
|