-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.svelte
50 lines (34 loc) · 988 Bytes
/
main.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
export let OLSKEmojiPickerDispatchSelect;
import { OLSKLocalized } from 'OLSKInternational';
import { OLSK_SPEC_UI } from 'OLSKSpec';
const mod = {
// MESSAGE
EmojiPickerDidClick (event) {
OLSKEmojiPickerDispatchSelect(event.detail.unicode);
},
// SETUP
SetupEverything() {
if (OLSK_SPEC_UI()) {
return;
}
document.querySelector('.OLSKEmojiPicker').appendChild(new Picker({
i18n: OLSKLocalized('OLSKEmojiPickerStringsObject'),
}));
document.querySelector('emoji-picker').addEventListener('emoji-click', mod.EmojiPickerDidClick);
},
// LIFECYCLE
LifecycleModuleDidLoad() {
mod.SetupEverything();
},
};
import { onMount } from 'svelte';
onMount(mod.LifecycleModuleDidLoad);
import { Picker } from 'emoji-picker-element';
</script>
<div class="OLSKEmojiPicker">
{#if OLSK_SPEC_UI() }
<emoji-picker></emoji-picker>
<pre id="TestOLSKEmojiPickerStrings">{ JSON.stringify(OLSKLocalized('OLSKEmojiPickerStringsObject')) }</pre>
{/if}
</div>