whenFirstSeen("[data-ignore-user]", () => {
void import("./Component/User/Ignore").then(({ setup }) => setup());
});
+ whenFirstSeen("emoji-picker", () => {
+ void import("./Component/EmojiPicker/Setup");
+ });
}
--- /dev/null
+import { wheneverFirstSeen } from "WoltLabSuite/Core/Helper/Selector";
+import { Picker } from "emoji-picker-element";
+
+wheneverFirstSeen("emoji-picker", (emojiPicker: Picker) => {
+ emojiPicker.locale = window.LANGUAGE_CODE;
+
+ if (window.EmojiPickerLocales[window.LANGUAGE_CODE] !== undefined) {
+ emojiPicker.i18n = window.EmojiPickerLocales[window.LANGUAGE_CODE];
+ }
+});
-import { wheneverSeen } from "WoltLabSuite/Core/Helper/Selector";
-import { Picker } from "emoji-picker-element";
-
import "emoji-picker-element";
-void import("emoji-picker-element/i18n/de").then((emojiLanguage) => {
- wheneverSeen("emoji-picker", (emojiPicker: Picker) => {
- emojiPicker.locale = window.LANGUAGE_CODE;
- emojiPicker.i18n = emojiLanguage.default;
- });
-});
+import ar from "emoji-picker-element/i18n/ar";
+import de from "emoji-picker-element/i18n/de";
+import en from "emoji-picker-element/i18n/en";
+import es from "emoji-picker-element/i18n/es";
+import fr from "emoji-picker-element/i18n/fr";
+import hi from "emoji-picker-element/i18n/hi";
+import id from "emoji-picker-element/i18n/id";
+import it from "emoji-picker-element/i18n/it";
+import ms_MY from "emoji-picker-element/i18n/ms_MY";
+import nl from "emoji-picker-element/i18n/nl";
+import pl from "emoji-picker-element/i18n/pl";
+import pt_BR from "emoji-picker-element/i18n/pt_BR";
+import pt_PT from "emoji-picker-element/i18n/pt_PT";
+import ru_RU from "emoji-picker-element/i18n/ru_RU";
+import tr from "emoji-picker-element/i18n/tr";
+import zh_CN from "emoji-picker-element/i18n/zh_CN";
+
+window.EmojiPickerLocales = {
+ ar,
+ de,
+ en,
+ es,
+ fr,
+ hi,
+ id,
+ it,
+ ms_MY,
+ nl,
+ pl,
+ pt_BR,
+ pt_PT,
+ ru_RU,
+ tr,
+ zh_CN,
+};
// This is a workaround for TS2669.
+import { I18n } from "emoji-picker-element/shared";
+import type * as Language from "./Language";
+import { Template } from "./Template";
+
export {};
// This is duplicated from the regular `global.ts` that we cannot
type HasRegularVariant = boolean;
type IconMetadata = [Codepoint, HasRegularVariant];
-import type * as Language from "./Language";
-import { Template } from "./Template";
-
interface Reaction {
title: string;
renderedIcon: string;
HTMLParsedElement: HTMLParsedElement;
WoltLabLanguage: typeof Language;
WoltLabTemplate: typeof Template;
+ EmojiPickerLocales: {
+ [key: string]: I18n;
+ };
}
class HTMLParsedElement extends HTMLElement {
import type WoltlabCoreDialogControlElement from "WoltLabSuite/Core/Element/woltlab-core-dialog-control";
import type WoltlabCoreGoogleMapsElement from "WoltLabSuite/Core/Component/GoogleMaps/woltlab-core-google-maps";
import type WoltlabCoreFileElement from "WoltLabSuite/Core/Component/File/woltlab-core-file";
+import { I18n } from "emoji-picker-element/shared";
type Codepoint = string;
type HasRegularVariant = boolean;
};
WoltLabTemplate: new (template: string) => WoltLabTemplate;
+ EmojiPickerLocales: {
+ [key: string]: I18n;
+ };
}
interface String {
(0, LazyLoader_1.whenFirstSeen)("[data-ignore-user]", () => {
void new Promise((resolve_7, reject_7) => { require(["./Component/User/Ignore"], resolve_7, reject_7); }).then(tslib_1.__importStar).then(({ setup }) => setup());
});
+ (0, LazyLoader_1.whenFirstSeen)("emoji-picker", () => {
+ void new Promise((resolve_8, reject_8) => { require(["./Component/EmojiPicker/Setup"], resolve_8, reject_8); }).then(tslib_1.__importStar);
+ });
}
});
--- /dev/null
+define(["require", "exports", "WoltLabSuite/Core/Helper/Selector"], function (require, exports, Selector_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ (0, Selector_1.wheneverFirstSeen)("emoji-picker", (emojiPicker) => {
+ emojiPicker.locale = window.LANGUAGE_CODE;
+ if (window.EmojiPickerLocales[window.LANGUAGE_CODE] !== undefined) {
+ emojiPicker.i18n = window.EmojiPickerLocales[window.LANGUAGE_CODE];
+ }
+ });
+});