diff --git a/locales/en-US.yml b/locales/en-US.yml index 03ec9284ba..eb4ad495a1 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2073,7 +2073,13 @@ _experiments: postImportsCaption: "Allows users to import their posts from past Calckey,\ \ Misskey, Mastodon, Akkoma, and Pleroma accounts. It may cause slowdowns during\ \ load if your queue is bottlenecked." - _dialog: charactersExceeded: "Max characters exceeded! Current: {current}/Limit: {max}" charactersBelow: "Not enough characters! Current: {current}/Limit: {min}" +_skinTones: + yellow: "Yellow" + light: "Light" + mediumLight: "Medium Light" + medium: "Medium" + mediumDark: "Medium Dark" + dark: "Dark" diff --git a/packages/client/src/components/MkEmojiPicker.section.vue b/packages/client/src/components/MkEmojiPicker.section.vue index c6052c60ee..1a9bccb149 100644 --- a/packages/client/src/components/MkEmojiPicker.section.vue +++ b/packages/client/src/components/MkEmojiPicker.section.vue @@ -22,7 +22,14 @@ > @@ -49,6 +56,7 @@ const props = defineProps<{ initialShown?: boolean; skinToneSelector?: boolean; skinTones?: string[]; + skinToneLabels?: string[]; }>(); const localEmojis = ref([...props.emojis]); diff --git a/packages/client/src/components/MkEmojiPicker.vue b/packages/client/src/components/MkEmojiPicker.vue index 260898e6e6..88eaf3eedd 100644 --- a/packages/client/src/components/MkEmojiPicker.vue +++ b/packages/client/src/components/MkEmojiPicker.vue @@ -115,6 +115,7 @@ :key="category" :skin-tone-selector="category === 'people'" :skin-tones="unicodeEmojiSkinTones" + :skin-tone-labels="unicodeEmojiSkinToneLabels" :emojis=" emojilist .filter((e) => e.category === category) @@ -168,7 +169,6 @@ import XSection from "@/components/MkEmojiPicker.section.vue"; import { emojilist, unicodeEmojiCategories, - unicodeEmojiSkinTones, UnicodeEmojiDef, getNicelyLabeledCategory, } from "@/scripts/emojilist"; @@ -210,6 +210,24 @@ const { recentlyUsedEmojis, } = defaultStore.reactiveState; +const unicodeEmojiSkinTones = [ + "#FFDC5E", + "#F7DFCF", + "#F3D3A3", + "#D6AE89", + "#B17F56", + "#7D523C", +]; + +const unicodeEmojiSkinToneLabels = [ + i18n.ts._skinTones.yellow, + i18n.ts._skinTones.light, + i18n.ts._skinTones.mediumLight, + i18n.ts._skinTones.medium, + i18n.ts._skinTones.mediumDark, + i18n.ts._skinTones.dark, +]; + const size = computed(() => props.asReactionPicker ? reactionPickerSize.value : 1 ); diff --git a/packages/client/src/pages/settings/reaction.vue b/packages/client/src/pages/settings/reaction.vue index 65abaaa765..60f1ee03d0 100644 --- a/packages/client/src/pages/settings/reaction.vue +++ b/packages/client/src/pages/settings/reaction.vue @@ -47,22 +47,22 @@ - - - - - - @@ -137,6 +137,7 @@ import { i18n } from "@/i18n"; import { definePageMetadata } from "@/scripts/page-metadata"; import { deepClone } from "@/scripts/clone"; import { unisonReload } from "@/scripts/unison-reload"; +import {addSkinTone } from "@/scripts/emojilist"; async function reloadAsk() { const { canceled } = await os.confirm({ @@ -239,8 +240,11 @@ watch(enableEmojiReactions, async () => { }); watch(reactionPickerSkinTone, async () => { + reactions.forEach((emoji) => { + addSkinTone(emoji, reactionPickerSkinTone.value); + }); await reloadAsk(); -}) +}); const headerActions = $computed(() => []); diff --git a/packages/client/src/scripts/emojilist.ts b/packages/client/src/scripts/emojilist.ts index 5ae8bce3bd..6620635882 100644 --- a/packages/client/src/scripts/emojilist.ts +++ b/packages/client/src/scripts/emojilist.ts @@ -35,15 +35,6 @@ export const categoryMapping = { Flags: "flags", } as const; -export const unicodeEmojiSkinTones = [ - "#FFDC5E", - "#F7DFCF", - "#F3D3A3", - "#D6AE89", - "#B17F56", - "#7D523C", -]; - export function addSkinTone(emoji: string, skinTone?: number) { const individualData = import("unicode-emoji-json/data-by-emoji.json");