Очистить репозиторий перед переносом продукта

This commit is contained in:
AidarKC
2026-07-20 18:46:56 +04:00
parent cf33f9a3bd
commit 81493ac4be
665 changed files with 231 additions and 1124 deletions
+21 -21
View File
@@ -1,14 +1,14 @@
import {
TELEGRAM_EMOJI_GROUPS,
getTelegramEmojiAssetUrl,
getTelegramEmojiPreviewUrl,
} from './telegram-emoji-catalog.js?v=202607151545';
TWEMOJI_GROUPS,
getTwemojiAssetUrl,
getTwemojiPreviewUrl,
} from './twemoji-catalog.js?v=202607151545';
const RECENT_STORAGE_KEY = 'shine-ui-recent-emojis-v1';
const MAX_RECENT = 28;
const ALL_EMOJI_ITEMS = TELEGRAM_EMOJI_GROUPS.flatMap((group) => group.items);
const ALL_EMOJI_ITEMS = TWEMOJI_GROUPS.flatMap((group) => group.items);
const EMOJI_ASSET_BY_CHAR = new Map(ALL_EMOJI_ITEMS.map((item) => [item.emoji, item]));
const TELEGRAM_EMOJI_MATCHER = new RegExp(
const TWEMOJI_MATCHER = new RegExp(
[...EMOJI_ASSET_BY_CHAR.keys()]
.sort((left, right) => right.length - left.length)
.map((emoji) => emoji.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'))
@@ -38,11 +38,11 @@ function saveRecent(items) {
}
function appendAnimatedAsset(root, item) {
const previewUrl = item.previewUrl || getTelegramEmojiPreviewUrl(item.file);
const animatedUrl = item.animatedUrl || getTelegramEmojiAssetUrl(item.file);
const previewUrl = item.previewUrl || getTwemojiPreviewUrl(item.emoji);
const animatedUrl = item.animatedUrl || getTwemojiAssetUrl(item.emoji);
const hasAnimation = animatedUrl && animatedUrl !== previewUrl;
const image = document.createElement('img');
image.className = 'telegram-emoji-image';
image.className = 'twemoji-image';
image.alt = '';
image.decoding = 'async';
image.setAttribute('aria-hidden', 'true');
@@ -134,7 +134,7 @@ function appendAnimatedAsset(root, item) {
root.append(image);
}
export function stopAllTelegramEmojiAnimations() {
export function stopAllTwemojiAnimations() {
activeAnimation?.deactivate();
activeAnimation = null;
}
@@ -155,14 +155,14 @@ function createEmojiButton(item, onSelect) {
return button;
}
export function isTelegramAnimatedEmoji(emoji) {
export function hasTwemojiAsset(emoji) {
return EMOJI_ASSET_BY_CHAR.has(emoji);
}
export function createTelegramAnimatedEmoji(emoji, { className = '' } = {}) {
export function createTwemojiAsset(emoji, { className = '' } = {}) {
const item = EMOJI_ASSET_BY_CHAR.get(emoji);
const root = document.createElement('span');
root.className = `telegram-emoji ${className}`.trim();
root.className = `twemoji ${className}`.trim();
root.setAttribute('aria-label', emoji);
root.setAttribute('role', 'img');
@@ -175,16 +175,16 @@ export function createTelegramAnimatedEmoji(emoji, { className = '' } = {}) {
return root;
}
export function appendTelegramAnimatedText(root, text, { className = '' } = {}) {
export function appendTwemojiText(root, text, { className = '' } = {}) {
const source = String(text || '');
let cursor = 0;
let found = false;
TELEGRAM_EMOJI_MATCHER.lastIndex = 0;
for (const match of source.matchAll(TELEGRAM_EMOJI_MATCHER)) {
TWEMOJI_MATCHER.lastIndex = 0;
for (const match of source.matchAll(TWEMOJI_MATCHER)) {
const index = Number(match.index || 0);
if (index > cursor) root.append(document.createTextNode(source.slice(cursor, index)));
root.append(createTelegramAnimatedEmoji(match[0], { className }));
root.append(createTwemojiAsset(match[0], { className }));
cursor = index + match[0].length;
found = true;
}
@@ -224,7 +224,7 @@ export function createEmojiPicker({ onSelect }) {
categoryGrid.className = 'emoji-picker-grid';
categorySection.append(categoryTitle, categoryGrid);
let activeGroup = TELEGRAM_EMOJI_GROUPS[0];
let activeGroup = TWEMOJI_GROUPS[0];
const tabs = new Map();
const rememberAndSelect = (emoji) => {
@@ -238,13 +238,13 @@ export function createEmojiPicker({ onSelect }) {
const recentItems = (loadRecent().length ? loadRecent() : DEFAULT_RECENT)
.map((emoji) => EMOJI_ASSET_BY_CHAR.get(emoji))
.filter(Boolean);
stopAllTelegramEmojiAnimations();
stopAllTwemojiAnimations();
recentGrid.replaceChildren(...recentItems.map((item) => createEmojiButton(item, rememberAndSelect)));
};
const renderGroup = () => {
categoryTitle.textContent = activeGroup.label;
stopAllTelegramEmojiAnimations();
stopAllTwemojiAnimations();
categoryGrid.replaceChildren(...activeGroup.items.map((item) => createEmojiButton(item, rememberAndSelect)));
tabs.forEach((tab, groupId) => {
const active = groupId === activeGroup.id;
@@ -253,7 +253,7 @@ export function createEmojiPicker({ onSelect }) {
});
};
TELEGRAM_EMOJI_GROUPS.forEach((group) => {
TWEMOJI_GROUPS.forEach((group) => {
const tab = document.createElement('button');
tab.type = 'button';
tab.className = 'emoji-picker-tab';