@chayns-components/emoji-input 5.0.0-beta.92 → 5.0.0-beta.920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -15
- package/lib/{api → cjs/api}/item-storage/get.js +4 -5
- package/lib/cjs/api/item-storage/get.js.map +1 -0
- package/lib/{api → cjs/api}/item-storage/put.js +5 -6
- package/lib/cjs/api/item-storage/put.js.map +1 -0
- package/lib/cjs/components/emoji-input/EmojiInput.js +510 -0
- package/lib/cjs/components/emoji-input/EmojiInput.js.map +1 -0
- package/lib/cjs/components/emoji-input/EmojiInput.styles.js +132 -0
- package/lib/cjs/components/emoji-input/EmojiInput.styles.js.map +1 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js +45 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js +65 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.js +9 -11
- package/lib/cjs/components/emoji-picker/EmojiPicker.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.styles.js +3 -5
- package/lib/cjs/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +102 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +5 -6
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +69 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +49 -21
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +24 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +130 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +99 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js +52 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js +15 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
- package/lib/{constants → cjs/constants}/alignment.js +6 -8
- package/lib/cjs/constants/alignment.js.map +1 -0
- package/lib/{constants → cjs/constants}/categories.js +1 -2
- package/lib/cjs/constants/categories.js.map +1 -0
- package/lib/cjs/constants/emoji.js +3804 -0
- package/lib/cjs/constants/emoji.js.map +1 -0
- package/lib/cjs/constants/externalServerUrl.js +8 -0
- package/lib/cjs/constants/externalServerUrl.js.map +1 -0
- package/lib/cjs/constants/regex.js +15 -0
- package/lib/cjs/constants/regex.js.map +1 -0
- package/lib/{hooks → cjs/hooks}/emojiHistory.js +13 -15
- package/lib/cjs/hooks/emojiHistory.js.map +1 -0
- package/lib/{index.js → cjs/index.js} +3 -3
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/types/api.js +2 -0
- package/lib/cjs/types/api.js.map +1 -0
- package/lib/cjs/types/category.js +2 -0
- package/lib/cjs/types/category.js.map +1 -0
- package/lib/cjs/utils/emoji.js +104 -0
- package/lib/cjs/utils/emoji.js.map +1 -0
- package/lib/{utils → cjs/utils}/environment.js +6 -4
- package/lib/cjs/utils/environment.js.map +1 -0
- package/lib/cjs/utils/font.js +17 -0
- package/lib/cjs/utils/font.js.map +1 -0
- package/lib/cjs/utils/insert.js +110 -0
- package/lib/cjs/utils/insert.js.map +1 -0
- package/lib/cjs/utils/number.js +17 -0
- package/lib/cjs/utils/number.js.map +1 -0
- package/lib/cjs/utils/selection.js +255 -0
- package/lib/cjs/utils/selection.js.map +1 -0
- package/lib/cjs/utils/text.js +57 -0
- package/lib/cjs/utils/text.js.map +1 -0
- package/lib/esm/api/item-storage/get.js +30 -0
- package/lib/esm/api/item-storage/get.js.map +1 -0
- package/lib/esm/api/item-storage/put.js +35 -0
- package/lib/esm/api/item-storage/put.js.map +1 -0
- package/lib/esm/components/emoji-input/EmojiInput.js +497 -0
- package/lib/esm/components/emoji-input/EmojiInput.js.map +1 -0
- package/lib/esm/components/emoji-input/EmojiInput.styles.js +151 -0
- package/lib/esm/components/emoji-input/EmojiInput.styles.js.map +1 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js +38 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js +69 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.js +40 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.js.map +1 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.styles.js +16 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +96 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +18 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +76 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +136 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +20 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +121 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +98 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js +43 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js +8 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
- package/lib/esm/constants/alignment.js +13 -0
- package/lib/esm/constants/alignment.js.map +1 -0
- package/lib/esm/constants/categories.js +13 -0
- package/lib/esm/constants/categories.js.map +1 -0
- package/lib/esm/constants/emoji-de-DE.json +3827 -0
- package/lib/esm/constants/emoji.js +3798 -0
- package/lib/esm/constants/emoji.js.map +1 -0
- package/lib/esm/constants/externalServerUrl.js +2 -0
- package/lib/esm/constants/externalServerUrl.js.map +1 -0
- package/lib/esm/constants/regex.js +9 -0
- package/lib/esm/constants/regex.js.map +1 -0
- package/lib/esm/hooks/emojiHistory.js +83 -0
- package/lib/esm/hooks/emojiHistory.js.map +1 -0
- package/lib/{index.d.ts → esm/index.js} +2 -1
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/types/api.js +2 -0
- package/lib/esm/types/api.js.map +1 -0
- package/lib/esm/types/category.js +2 -0
- package/lib/esm/types/category.js.map +1 -0
- package/lib/esm/utils/emoji.js +92 -0
- package/lib/esm/utils/emoji.js.map +1 -0
- package/lib/esm/utils/environment.js +24 -0
- package/lib/esm/utils/environment.js.map +1 -0
- package/lib/esm/utils/font.js +10 -0
- package/lib/esm/utils/font.js.map +1 -0
- package/lib/esm/utils/insert.js +104 -0
- package/lib/esm/utils/insert.js.map +1 -0
- package/lib/esm/utils/number.js +10 -0
- package/lib/esm/utils/number.js.map +1 -0
- package/lib/esm/utils/selection.js +237 -0
- package/lib/esm/utils/selection.js.map +1 -0
- package/lib/esm/utils/text.js +48 -0
- package/lib/esm/utils/text.js.map +1 -0
- package/lib/types/components/emoji-input/EmojiInput.d.ts +94 -0
- package/lib/types/components/emoji-input/EmojiInput.styles.d.ts +549 -0
- package/lib/types/components/emoji-input/prefix-element/PrefixElement.d.ts +8 -0
- package/lib/types/components/emoji-input/prefix-element/PrefixElement.styles.d.ts +12 -0
- package/lib/types/components/emoji-picker/EmojiPicker.styles.d.ts +5 -0
- package/lib/types/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +267 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +10 -0
- package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.d.ts +5 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +6 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +283 -0
- package/lib/{components → types/components}/emoji-picker-popup/EmojiPickerPopup.d.ts +0 -13
- package/lib/types/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +1 -0
- package/lib/types/constants/emoji.d.ts +8 -0
- package/lib/types/constants/regex.d.ts +8 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/utils/emoji.d.ts +4 -0
- package/lib/{utils → types/utils}/environment.d.ts +1 -0
- package/lib/types/utils/font.d.ts +1 -0
- package/lib/{utils → types/utils}/insert.d.ts +8 -1
- package/lib/types/utils/number.d.ts +1 -0
- package/lib/types/utils/selection.d.ts +23 -0
- package/lib/types/utils/text.d.ts +3 -0
- package/package.json +48 -30
- package/lib/api/item-storage/get.js.map +0 -1
- package/lib/api/item-storage/put.js.map +0 -1
- package/lib/components/emoji-input/EmojiInput.d.ts +0 -49
- package/lib/components/emoji-input/EmojiInput.js +0 -160
- package/lib/components/emoji-input/EmojiInput.js.map +0 -1
- package/lib/components/emoji-input/EmojiInput.styles.d.ts +0 -16
- package/lib/components/emoji-input/EmojiInput.styles.js +0 -153
- package/lib/components/emoji-input/EmojiInput.styles.js.map +0 -1
- package/lib/components/emoji-picker/EmojiPicker.js.map +0 -1
- package/lib/components/emoji-picker/EmojiPicker.styles.d.ts +0 -5
- package/lib/components/emoji-picker/EmojiPicker.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +0 -51
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +0 -2
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +0 -131
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +0 -7
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +0 -99
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +0 -20
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +0 -74
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +0 -11
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +0 -104
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +0 -1
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.js +0 -150
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +0 -1
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +0 -7
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js +0 -97
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +0 -1
- package/lib/constants/alignment.js.map +0 -1
- package/lib/constants/categories.js.map +0 -1
- package/lib/constants/externalServerUrl.js +0 -9
- package/lib/constants/externalServerUrl.js.map +0 -1
- package/lib/hooks/emojiHistory.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types/api.js +0 -6
- package/lib/types/api.js.map +0 -1
- package/lib/types/category.js +0 -6
- package/lib/types/category.js.map +0 -1
- package/lib/utils/emoji.d.ts +0 -2
- package/lib/utils/emoji.js +0 -205
- package/lib/utils/emoji.js.map +0 -1
- package/lib/utils/environment.js.map +0 -1
- package/lib/utils/font.d.ts +0 -1
- package/lib/utils/font.js +0 -15
- package/lib/utils/font.js.map +0 -1
- package/lib/utils/insert.js +0 -57
- package/lib/utils/insert.js.map +0 -1
- package/lib/utils/selection.d.ts +0 -2
- package/lib/utils/selection.js +0 -43
- package/lib/utils/selection.js.map +0 -1
- /package/lib/{constants → cjs/constants}/emoji-de-DE.json +0 -0
- /package/lib/{api → types/api}/item-storage/get.d.ts +0 -0
- /package/lib/{api → types/api}/item-storage/put.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/EmojiPicker.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +0 -0
- /package/lib/{constants → types/constants}/alignment.d.ts +0 -0
- /package/lib/{constants → types/constants}/categories.d.ts +0 -0
- /package/lib/{constants → types/constants}/externalServerUrl.d.ts +0 -0
- /package/lib/{hooks → types/hooks}/emojiHistory.d.ts +0 -0
- /package/lib/types/{api.d.ts → types/api.d.ts} +0 -0
- /package/lib/types/{category.d.ts → types/category.d.ts} +0 -0
package/lib/utils/emoji.js
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertAsciiToUnicode = exports.addSkinToneToEmoji = void 0;
|
|
7
|
-
var _dataByEmoji = _interopRequireDefault(require("unicode-emoji-json/data-by-emoji.json"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
const asciiList = {
|
|
10
|
-
'*\\0/*': '1f646',
|
|
11
|
-
'*\\O/*': '1f646',
|
|
12
|
-
'-___-': '1f611',
|
|
13
|
-
":'-)": '1f602',
|
|
14
|
-
"':-)": '1f605',
|
|
15
|
-
"':-D": '1f605',
|
|
16
|
-
'>:-)': '1f606',
|
|
17
|
-
"':-(": '1f613',
|
|
18
|
-
'>:-(': '1f620',
|
|
19
|
-
":'-(": '1f622',
|
|
20
|
-
'O:-)': '1f607',
|
|
21
|
-
'0:-3': '1f607',
|
|
22
|
-
'0:-)': '1f607',
|
|
23
|
-
'0;^)': '1f607',
|
|
24
|
-
'O;-)': '1f607',
|
|
25
|
-
'0;-)': '1f607',
|
|
26
|
-
'O:-3': '1f607',
|
|
27
|
-
'-__-': '1f611',
|
|
28
|
-
':-Þ': '1f61b',
|
|
29
|
-
'</3': '1f494',
|
|
30
|
-
":')": '1f602',
|
|
31
|
-
':-D': '1f603',
|
|
32
|
-
"':)": '1f605',
|
|
33
|
-
"'=)": '1f605',
|
|
34
|
-
"':D": '1f605',
|
|
35
|
-
"'=D": '1f605',
|
|
36
|
-
'>:)': '1f606',
|
|
37
|
-
'>;)': '1f606',
|
|
38
|
-
'>=)': '1f606',
|
|
39
|
-
';-)': '1f609',
|
|
40
|
-
'*-)': '1f609',
|
|
41
|
-
';-]': '1f609',
|
|
42
|
-
';^)': '1f609',
|
|
43
|
-
"':(": '1f613',
|
|
44
|
-
"'=(": '1f613',
|
|
45
|
-
':-*': '1f618',
|
|
46
|
-
':^*': '1f618',
|
|
47
|
-
'>:P': '1f61c',
|
|
48
|
-
'X-P': '1f61c',
|
|
49
|
-
'>:[': '1f61e',
|
|
50
|
-
':-(': '1f61e',
|
|
51
|
-
':-[': '1f61e',
|
|
52
|
-
'>:(': '1f620',
|
|
53
|
-
":'(": '1f622',
|
|
54
|
-
';-(': '1f622',
|
|
55
|
-
'>.<': '1f623',
|
|
56
|
-
'#-)': '1f635',
|
|
57
|
-
'%-)': '1f635',
|
|
58
|
-
'X-)': '1f635',
|
|
59
|
-
'\\0/': '1f646',
|
|
60
|
-
'\\O/': '1f646',
|
|
61
|
-
'0:3': '1f607',
|
|
62
|
-
'0:)': '1f607',
|
|
63
|
-
'O:)': '1f607',
|
|
64
|
-
'O=)': '1f607',
|
|
65
|
-
'O:3': '1f607',
|
|
66
|
-
'B-)': '1f60e',
|
|
67
|
-
'8-)': '1f60e',
|
|
68
|
-
'B-D': '1f60e',
|
|
69
|
-
'8-D': '1f60e',
|
|
70
|
-
'-_-': '1f611',
|
|
71
|
-
'>:\\': '1f615',
|
|
72
|
-
'>:/': '1f615',
|
|
73
|
-
':-/': '1f615',
|
|
74
|
-
':-.': '1f615',
|
|
75
|
-
':-P': '1f61b',
|
|
76
|
-
':Þ': '1f61b',
|
|
77
|
-
':-b': '1f61b',
|
|
78
|
-
':-O': '1f62e',
|
|
79
|
-
O_O: '1f62e',
|
|
80
|
-
'>:O': '1f62e',
|
|
81
|
-
':-X': '1f636',
|
|
82
|
-
':-#': '1f636',
|
|
83
|
-
':-)': '1f642',
|
|
84
|
-
'(y)': '1f44d',
|
|
85
|
-
'<3': '2764-fe0f',
|
|
86
|
-
'=D': '1f603',
|
|
87
|
-
';)': '1f609',
|
|
88
|
-
'*)': '1f609',
|
|
89
|
-
';]': '1f609',
|
|
90
|
-
';D': '1f609',
|
|
91
|
-
':*': '1f618',
|
|
92
|
-
'=*': '1f618',
|
|
93
|
-
':(': '1f61e',
|
|
94
|
-
':[': '1f61e',
|
|
95
|
-
'=(': '1f61e',
|
|
96
|
-
':@': '1f620',
|
|
97
|
-
';(': '1f622',
|
|
98
|
-
'D:': '1f628',
|
|
99
|
-
':$': '1f633',
|
|
100
|
-
'=$': '1f633',
|
|
101
|
-
'#)': '1f635',
|
|
102
|
-
'%)': '1f635',
|
|
103
|
-
'X)': '1f635',
|
|
104
|
-
'B)': '1f60e',
|
|
105
|
-
'8)': '1f60e',
|
|
106
|
-
':/': '1f615',
|
|
107
|
-
':\\': '1f615',
|
|
108
|
-
'=/': '1f615',
|
|
109
|
-
'=\\': '1f615',
|
|
110
|
-
':L': '1f615',
|
|
111
|
-
'=L': '1f615',
|
|
112
|
-
':P': '1f61b',
|
|
113
|
-
'=P': '1f61b',
|
|
114
|
-
':b': '1f61b',
|
|
115
|
-
':O': '1f62e',
|
|
116
|
-
':X': '1f636',
|
|
117
|
-
':#': '1f636',
|
|
118
|
-
'=X': '1f636',
|
|
119
|
-
'=#': '1f636',
|
|
120
|
-
':)': '1f642',
|
|
121
|
-
'=]': '1f642',
|
|
122
|
-
'=)': '1f642',
|
|
123
|
-
':]': '1f642',
|
|
124
|
-
':D': '1f604'
|
|
125
|
-
};
|
|
126
|
-
const asciiRegexp = "(\\*\\\\0\\/\\*|\\*\\\\O\\/\\*|\\-___\\-|\\:'\\-\\)|'\\:\\-\\)|'\\:\\-D|\\>\\:\\-\\)|>\\:\\-\\)|'\\:\\-\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:'\\-\\(|O\\:\\-\\)|0\\:\\-3|0\\:\\-\\)|0;\\^\\)|O;\\-\\)|0;\\-\\)|O\\:\\-3|\\-__\\-|\\:\\-Þ|\\:\\-Þ|\\<\\/3|<\\/3|\\:'\\)|\\:\\-D|'\\:\\)|'\\=\\)|'\\:D|'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\=\\)|>\\=\\)|;\\-\\)|\\*\\-\\)|;\\-\\]|;\\^\\)|'\\:\\(|'\\=\\(|\\:\\-\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\-\\[|\\>\\:\\(|>\\:\\(|\\:'\\(|;\\-\\(|\\>\\.\\<|>\\.<|#\\-\\)|%\\-\\)|X\\-\\)|\\\\0\\/|\\\\O\\/|0\\:3|0\\:\\)|O\\:\\)|O\\=\\)|O\\:3|B\\-\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\-P|\\:Þ|\\:Þ|\\:\\-b|\\:\\-O|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:\\-#|\\:\\-\\)|\\(y\\)|\\<3|<3|\\=D|;\\)|\\*\\)|;\\]|;D|\\:\\*|\\=\\*|\\:\\(|\\:\\[|\\=\\(|\\:@|;\\(|D\\:|\\:\\$|\\=\\$|#\\)|%\\)|X\\)|B\\)|8\\)|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\=P|\\:b|\\:O|\\:X|\\:#|\\=X|\\=#|\\:\\)|\\=\\]|\\=\\)|\\:\\]|\\:D)";
|
|
127
|
-
const regAscii = new RegExp(`<object[^>]*>.*?</object>|<span[^>]*>.*?</span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)${asciiRegexp}(?=\\s|$|[!,.?]))`, 'gi');
|
|
128
|
-
const convert = unicode => {
|
|
129
|
-
if (unicode.indexOf('-') > -1) {
|
|
130
|
-
const parts = [];
|
|
131
|
-
const s = unicode.split('-');
|
|
132
|
-
for (let i = 0; i < s.length; i++) {
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
134
|
-
let part = parseInt(s[i], 16);
|
|
135
|
-
if (part >= 0x10000 && part <= 0x10ffff) {
|
|
136
|
-
const hi = Math.floor((part - 0x10000) / 0x400) + 0xd800;
|
|
137
|
-
const lo = (part - 0x10000) % 0x400 + 0xdc00;
|
|
138
|
-
part = String.fromCharCode(hi) + String.fromCharCode(lo);
|
|
139
|
-
} else {
|
|
140
|
-
part = String.fromCharCode(part);
|
|
141
|
-
}
|
|
142
|
-
parts.push(part);
|
|
143
|
-
}
|
|
144
|
-
return parts.join('');
|
|
145
|
-
}
|
|
146
|
-
const s = parseInt(unicode, 16);
|
|
147
|
-
if (s >= 0x10000 && s <= 0x10ffff) {
|
|
148
|
-
const hi = Math.floor((s - 0x10000) / 0x400) + 0xd800;
|
|
149
|
-
const lo = (s - 0x10000) % 0x400 + 0xdc00;
|
|
150
|
-
return String.fromCharCode(hi) + String.fromCharCode(lo);
|
|
151
|
-
}
|
|
152
|
-
return String.fromCharCode(s);
|
|
153
|
-
};
|
|
154
|
-
const unescapeHTML = text => {
|
|
155
|
-
const unescaped = {
|
|
156
|
-
'&': '&',
|
|
157
|
-
'&': '&',
|
|
158
|
-
'&': '&',
|
|
159
|
-
'<': '<',
|
|
160
|
-
'<': '<',
|
|
161
|
-
'<': '<',
|
|
162
|
-
'>': '>',
|
|
163
|
-
'>': '>',
|
|
164
|
-
'>': '>',
|
|
165
|
-
'"': '"',
|
|
166
|
-
'"': '"',
|
|
167
|
-
'"': '"',
|
|
168
|
-
''': "'",
|
|
169
|
-
''': "'",
|
|
170
|
-
''': "'"
|
|
171
|
-
};
|
|
172
|
-
return text.replace(/&(?:amp|#38|#x26|lt|#60|#x3C|gt|#62|#x3E|apos|#39|#x27|quot|#34|#x22);/gi, match => {
|
|
173
|
-
var _unescaped$match;
|
|
174
|
-
return (_unescaped$match = unescaped[match]) !== null && _unescaped$match !== void 0 ? _unescaped$match : match;
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
const convertAsciiToUnicode = text => {
|
|
178
|
-
let unicode;
|
|
179
|
-
return text.replace(regAscii, (entire, m1, m2, m3) => {
|
|
180
|
-
if (typeof m3 === 'undefined' || m3 === '' || !(unescapeHTML(m3) in asciiList)) {
|
|
181
|
-
return entire;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// eslint-disable-next-line no-param-reassign
|
|
185
|
-
m3 = unescapeHTML(m3);
|
|
186
|
-
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
188
|
-
unicode = asciiList[m3].toUpperCase();
|
|
189
|
-
return m2 + convert(unicode);
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
exports.convertAsciiToUnicode = convertAsciiToUnicode;
|
|
193
|
-
const addSkinToneToEmoji = (emoji, skinTone) => emoji.split('\u{200D}').map(rawEmoji => {
|
|
194
|
-
var _emojiList$rawEmoji;
|
|
195
|
-
const parts = [rawEmoji.replace(/\ufe0f/, '')];
|
|
196
|
-
|
|
197
|
-
// @ts-expect-error: Difficult to type external json file
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
199
|
-
if ((_emojiList$rawEmoji = _dataByEmoji.default[rawEmoji]) !== null && _emojiList$rawEmoji !== void 0 && _emojiList$rawEmoji.skin_tone_support) {
|
|
200
|
-
parts.push(skinTone);
|
|
201
|
-
}
|
|
202
|
-
return parts.join('');
|
|
203
|
-
}).join('\u{200D}');
|
|
204
|
-
exports.addSkinToneToEmoji = addSkinToneToEmoji;
|
|
205
|
-
//# sourceMappingURL=emoji.js.map
|
package/lib/utils/emoji.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emoji.js","names":["_dataByEmoji","_interopRequireDefault","require","obj","__esModule","default","asciiList","O_O","asciiRegexp","regAscii","RegExp","convert","unicode","indexOf","parts","s","split","i","length","part","parseInt","hi","Math","floor","lo","String","fromCharCode","push","join","unescapeHTML","text","unescaped","replace","match","_unescaped$match","convertAsciiToUnicode","entire","m1","m2","m3","toUpperCase","exports","addSkinToneToEmoji","emoji","skinTone","map","rawEmoji","_emojiList$rawEmoji","emojiList","skin_tone_support"],"sources":["../../src/utils/emoji.ts"],"sourcesContent":["import emojiList from 'unicode-emoji-json/data-by-emoji.json';\n\nconst asciiList: { [key: string]: string } = {\n '*\\\\0/*': '1f646',\n '*\\\\O/*': '1f646',\n '-___-': '1f611',\n \":'-)\": '1f602',\n \"':-)\": '1f605',\n \"':-D\": '1f605',\n '>:-)': '1f606',\n \"':-(\": '1f613',\n '>:-(': '1f620',\n \":'-(\": '1f622',\n 'O:-)': '1f607',\n '0:-3': '1f607',\n '0:-)': '1f607',\n '0;^)': '1f607',\n 'O;-)': '1f607',\n '0;-)': '1f607',\n 'O:-3': '1f607',\n '-__-': '1f611',\n ':-Þ': '1f61b',\n '</3': '1f494',\n \":')\": '1f602',\n ':-D': '1f603',\n \"':)\": '1f605',\n \"'=)\": '1f605',\n \"':D\": '1f605',\n \"'=D\": '1f605',\n '>:)': '1f606',\n '>;)': '1f606',\n '>=)': '1f606',\n ';-)': '1f609',\n '*-)': '1f609',\n ';-]': '1f609',\n ';^)': '1f609',\n \"':(\": '1f613',\n \"'=(\": '1f613',\n ':-*': '1f618',\n ':^*': '1f618',\n '>:P': '1f61c',\n 'X-P': '1f61c',\n '>:[': '1f61e',\n ':-(': '1f61e',\n ':-[': '1f61e',\n '>:(': '1f620',\n \":'(\": '1f622',\n ';-(': '1f622',\n '>.<': '1f623',\n '#-)': '1f635',\n '%-)': '1f635',\n 'X-)': '1f635',\n '\\\\0/': '1f646',\n '\\\\O/': '1f646',\n '0:3': '1f607',\n '0:)': '1f607',\n 'O:)': '1f607',\n 'O=)': '1f607',\n 'O:3': '1f607',\n 'B-)': '1f60e',\n '8-)': '1f60e',\n 'B-D': '1f60e',\n '8-D': '1f60e',\n '-_-': '1f611',\n '>:\\\\': '1f615',\n '>:/': '1f615',\n ':-/': '1f615',\n ':-.': '1f615',\n ':-P': '1f61b',\n ':Þ': '1f61b',\n ':-b': '1f61b',\n ':-O': '1f62e',\n O_O: '1f62e',\n '>:O': '1f62e',\n ':-X': '1f636',\n ':-#': '1f636',\n ':-)': '1f642',\n '(y)': '1f44d',\n '<3': '2764-fe0f',\n '=D': '1f603',\n ';)': '1f609',\n '*)': '1f609',\n ';]': '1f609',\n ';D': '1f609',\n ':*': '1f618',\n '=*': '1f618',\n ':(': '1f61e',\n ':[': '1f61e',\n '=(': '1f61e',\n ':@': '1f620',\n ';(': '1f622',\n 'D:': '1f628',\n ':$': '1f633',\n '=$': '1f633',\n '#)': '1f635',\n '%)': '1f635',\n 'X)': '1f635',\n 'B)': '1f60e',\n '8)': '1f60e',\n ':/': '1f615',\n ':\\\\': '1f615',\n '=/': '1f615',\n '=\\\\': '1f615',\n ':L': '1f615',\n '=L': '1f615',\n ':P': '1f61b',\n '=P': '1f61b',\n ':b': '1f61b',\n ':O': '1f62e',\n ':X': '1f636',\n ':#': '1f636',\n '=X': '1f636',\n '=#': '1f636',\n ':)': '1f642',\n '=]': '1f642',\n '=)': '1f642',\n ':]': '1f642',\n ':D': '1f604',\n};\n\nconst asciiRegexp =\n \"(\\\\*\\\\\\\\0\\\\/\\\\*|\\\\*\\\\\\\\O\\\\/\\\\*|\\\\-___\\\\-|\\\\:'\\\\-\\\\)|'\\\\:\\\\-\\\\)|'\\\\:\\\\-D|\\\\>\\\\:\\\\-\\\\)|>\\\\:\\\\-\\\\)|'\\\\:\\\\-\\\\(|\\\\>\\\\:\\\\-\\\\(|>\\\\:\\\\-\\\\(|\\\\:'\\\\-\\\\(|O\\\\:\\\\-\\\\)|0\\\\:\\\\-3|0\\\\:\\\\-\\\\)|0;\\\\^\\\\)|O;\\\\-\\\\)|0;\\\\-\\\\)|O\\\\:\\\\-3|\\\\-__\\\\-|\\\\:\\\\-Þ|\\\\:\\\\-Þ|\\\\<\\\\/3|<\\\\/3|\\\\:'\\\\)|\\\\:\\\\-D|'\\\\:\\\\)|'\\\\=\\\\)|'\\\\:D|'\\\\=D|\\\\>\\\\:\\\\)|>\\\\:\\\\)|\\\\>;\\\\)|>;\\\\)|\\\\>\\\\=\\\\)|>\\\\=\\\\)|;\\\\-\\\\)|\\\\*\\\\-\\\\)|;\\\\-\\\\]|;\\\\^\\\\)|'\\\\:\\\\(|'\\\\=\\\\(|\\\\:\\\\-\\\\*|\\\\:\\\\^\\\\*|\\\\>\\\\:P|>\\\\:P|X\\\\-P|\\\\>\\\\:\\\\[|>\\\\:\\\\[|\\\\:\\\\-\\\\(|\\\\:\\\\-\\\\[|\\\\>\\\\:\\\\(|>\\\\:\\\\(|\\\\:'\\\\(|;\\\\-\\\\(|\\\\>\\\\.\\\\<|>\\\\.<|#\\\\-\\\\)|%\\\\-\\\\)|X\\\\-\\\\)|\\\\\\\\0\\\\/|\\\\\\\\O\\\\/|0\\\\:3|0\\\\:\\\\)|O\\\\:\\\\)|O\\\\=\\\\)|O\\\\:3|B\\\\-\\\\)|8\\\\-\\\\)|B\\\\-D|8\\\\-D|\\\\-_\\\\-|\\\\>\\\\:\\\\\\\\|>\\\\:\\\\\\\\|\\\\>\\\\:\\\\/|>\\\\:\\\\/|\\\\:\\\\-\\\\/|\\\\:\\\\-\\\\.|\\\\:\\\\-P|\\\\:Þ|\\\\:Þ|\\\\:\\\\-b|\\\\:\\\\-O|O_O|\\\\>\\\\:O|>\\\\:O|\\\\:\\\\-X|\\\\:\\\\-#|\\\\:\\\\-\\\\)|\\\\(y\\\\)|\\\\<3|<3|\\\\=D|;\\\\)|\\\\*\\\\)|;\\\\]|;D|\\\\:\\\\*|\\\\=\\\\*|\\\\:\\\\(|\\\\:\\\\[|\\\\=\\\\(|\\\\:@|;\\\\(|D\\\\:|\\\\:\\\\$|\\\\=\\\\$|#\\\\)|%\\\\)|X\\\\)|B\\\\)|8\\\\)|\\\\:\\\\/|\\\\:\\\\\\\\|\\\\=\\\\/|\\\\=\\\\\\\\|\\\\:L|\\\\=L|\\\\:P|\\\\=P|\\\\:b|\\\\:O|\\\\:X|\\\\:#|\\\\=X|\\\\=#|\\\\:\\\\)|\\\\=\\\\]|\\\\=\\\\)|\\\\:\\\\]|\\\\:D)\";\n\nconst regAscii = new RegExp(\n `<object[^>]*>.*?</object>|<span[^>]*>.*?</span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\\\s|^)${asciiRegexp}(?=\\\\s|$|[!,.?]))`,\n 'gi'\n);\n\nconst convert = (unicode: string) => {\n if (unicode.indexOf('-') > -1) {\n const parts = [];\n\n const s = unicode.split('-');\n\n for (let i = 0; i < s.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let part: number | string = parseInt(s[i]!, 16);\n\n if (part >= 0x10000 && part <= 0x10ffff) {\n const hi = Math.floor((part - 0x10000) / 0x400) + 0xd800;\n const lo = ((part - 0x10000) % 0x400) + 0xdc00;\n\n part = String.fromCharCode(hi) + String.fromCharCode(lo);\n } else {\n part = String.fromCharCode(part);\n }\n\n parts.push(part);\n }\n\n return parts.join('');\n }\n\n const s = parseInt(unicode, 16);\n\n if (s >= 0x10000 && s <= 0x10ffff) {\n const hi = Math.floor((s - 0x10000) / 0x400) + 0xd800;\n const lo = ((s - 0x10000) % 0x400) + 0xdc00;\n\n return String.fromCharCode(hi) + String.fromCharCode(lo);\n }\n\n return String.fromCharCode(s);\n};\n\nconst unescapeHTML = (text: string) => {\n const unescaped: { [key: string]: string } = {\n '&': '&',\n '&': '&',\n '&': '&',\n '<': '<',\n '<': '<',\n '<': '<',\n '>': '>',\n '>': '>',\n '>': '>',\n '"': '\"',\n '"': '\"',\n '"': '\"',\n ''': \"'\",\n ''': \"'\",\n ''': \"'\",\n };\n\n return text.replace(\n /&(?:amp|#38|#x26|lt|#60|#x3C|gt|#62|#x3E|apos|#39|#x27|quot|#34|#x22);/gi,\n (match) => unescaped[match] ?? match\n );\n};\n\nexport const convertAsciiToUnicode = (text: string): string => {\n let unicode: string;\n\n return text.replace(regAscii, (entire, m1, m2, m3) => {\n if (typeof m3 === 'undefined' || m3 === '' || !(unescapeHTML(m3 as string) in asciiList)) {\n return entire;\n }\n\n // eslint-disable-next-line no-param-reassign\n m3 = unescapeHTML(m3 as string);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n unicode = asciiList[m3 as string]!.toUpperCase();\n\n return (m2 as string) + convert(unicode);\n });\n};\n\nexport const addSkinToneToEmoji = (emoji: string, skinTone: string): string =>\n emoji\n .split('\\u{200D}')\n .map((rawEmoji) => {\n const parts = [rawEmoji.replace(/\\ufe0f/, '')];\n\n // @ts-expect-error: Difficult to type external json file\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (emojiList[rawEmoji]?.skin_tone_support) {\n parts.push(skinTone);\n }\n\n return parts.join('');\n })\n .join('\\u{200D}');\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE9D,MAAMG,SAAoC,GAAG;EACzC,QAAQ,EAAE,OAAO;EACjB,QAAQ,EAAE,OAAO;EACjB,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,MAAM,EAAE,OAAO;EACf,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,OA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,CAACc,IAAI,CAAC,EAAE,CAAC;AACzB,CAAC,CAAC,CACDA,IAAI,CAAC,UAAU,CAAC;AAACa,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","names":["DeviceType","getDeviceType","userAgent","navigator","test","Smartphone","Tablet","Desktop","exports","getIsMobile","deviceType"],"sources":["../../src/utils/environment.ts"],"sourcesContent":["enum DeviceType {\n Desktop,\n Smartphone,\n Tablet,\n}\n\nexport const getDeviceType = (): DeviceType => {\n const { userAgent } = navigator;\n\n if (\n /Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(\n userAgent\n )\n ) {\n return DeviceType.Smartphone;\n }\n\n if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(userAgent)) {\n return DeviceType.Tablet;\n }\n\n return DeviceType.Desktop;\n};\n\nexport const getIsMobile = (): boolean => {\n const deviceType = getDeviceType();\n\n return deviceType === DeviceType.Smartphone || deviceType === DeviceType.Tablet;\n};\n"],"mappings":";;;;;;IAAKA,UAAU;AAAA,WAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU;AAMR,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAM;IAAEC;EAAU,CAAC,GAAGC,SAAS;EAE/B,IACI,qGAAqG,CAACC,IAAI,CACtGF,SAAS,CACZ,EACH;IACE,OAAOF,UAAU,CAACK,UAAU;EAChC;EAEA,IAAI,kDAAkD,CAACD,IAAI,CAACF,SAAS,CAAC,EAAE;IACpE,OAAOF,UAAU,CAACM,MAAM;EAC5B;EAEA,OAAON,UAAU,CAACO,OAAO;AAC7B,CAAC;AAACC,OAAA,CAAAP,aAAA,GAAAA,aAAA;AAEK,MAAMQ,WAAW,GAAGA,CAAA,KAAe;EACtC,MAAMC,UAAU,GAAGT,aAAa,EAAE;EAElC,OAAOS,UAAU,KAAKV,UAAU,CAACK,UAAU,IAAIK,UAAU,KAAKV,UAAU,CAACM,MAAM;AACnF,CAAC;AAACE,OAAA,CAAAC,WAAA,GAAAA,WAAA"}
|
package/lib/utils/font.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getRootFontFamily: () => string;
|
package/lib/utils/font.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getRootFontFamily = void 0;
|
|
7
|
-
const getRootFontFamily = () => {
|
|
8
|
-
const rootElement = document.querySelector(':root');
|
|
9
|
-
if (!rootElement) {
|
|
10
|
-
return '';
|
|
11
|
-
}
|
|
12
|
-
return window.getComputedStyle(rootElement).getPropertyValue('font-family');
|
|
13
|
-
};
|
|
14
|
-
exports.getRootFontFamily = getRootFontFamily;
|
|
15
|
-
//# sourceMappingURL=font.js.map
|
package/lib/utils/font.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","names":["getRootFontFamily","rootElement","document","querySelector","window","getComputedStyle","getPropertyValue","exports"],"sources":["../../src/utils/font.ts"],"sourcesContent":["export const getRootFontFamily = () => {\n const rootElement = document.querySelector(':root');\n\n if (!rootElement) {\n return '';\n }\n\n return window.getComputedStyle(rootElement).getPropertyValue('font-family');\n};\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAGA,CAAA,KAAM;EACnC,MAAMC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAEnD,IAAI,CAACF,WAAW,EAAE;IACd,OAAO,EAAE;EACb;EAEA,OAAOG,MAAM,CAACC,gBAAgB,CAACJ,WAAW,CAAC,CAACK,gBAAgB,CAAC,aAAa,CAAC;AAC/E,CAAC;AAACC,OAAA,CAAAP,iBAAA,GAAAA,iBAAA"}
|
package/lib/utils/insert.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.insertTextAtCursorPosition = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* This function inserts the passed text at the correct position in the editor element. If the
|
|
9
|
-
* element has the focus, the new emoji is inserted at the cursor position. If not, the emoji
|
|
10
|
-
* will be appended to the back of the input field content.
|
|
11
|
-
*
|
|
12
|
-
* In addition, this function also sets the cursor to the correct position when the input field
|
|
13
|
-
* has the focus. For this purpose, the current position of the cursor or a selection is read to
|
|
14
|
-
* calculate the cursor position after inserting the text.
|
|
15
|
-
*
|
|
16
|
-
* @param {Object} options - Object with element and text to insert
|
|
17
|
-
* @param {HTMLDivElement} options.editorElement - Element to insert text into
|
|
18
|
-
* @param {string} options.text - Text to insert into element
|
|
19
|
-
*/
|
|
20
|
-
const insertTextAtCursorPosition = _ref => {
|
|
21
|
-
let {
|
|
22
|
-
editorElement,
|
|
23
|
-
text
|
|
24
|
-
} = _ref;
|
|
25
|
-
const selection = window.getSelection();
|
|
26
|
-
if (selection !== null && selection !== void 0 && selection.anchorNode && editorElement.contains(selection.anchorNode)) {
|
|
27
|
-
const {
|
|
28
|
-
endOffset,
|
|
29
|
-
startOffset
|
|
30
|
-
} = selection.getRangeAt(0);
|
|
31
|
-
const rangeDistance = endOffset - startOffset;
|
|
32
|
-
let offset = endOffset + text.length - rangeDistance;
|
|
33
|
-
let {
|
|
34
|
-
anchorNode
|
|
35
|
-
} = selection;
|
|
36
|
-
if (anchorNode.nodeValue) {
|
|
37
|
-
anchorNode.nodeValue = anchorNode.nodeValue.substring(0, startOffset) + text + anchorNode.nodeValue.substring(endOffset);
|
|
38
|
-
} else if (anchorNode === editorElement) {
|
|
39
|
-
const newTextNode = document.createTextNode(text);
|
|
40
|
-
editorElement.appendChild(newTextNode);
|
|
41
|
-
anchorNode = newTextNode;
|
|
42
|
-
}
|
|
43
|
-
const newRange = document.createRange();
|
|
44
|
-
if (anchorNode.nodeValue) {
|
|
45
|
-
offset = Math.min(offset, anchorNode.nodeValue.length);
|
|
46
|
-
}
|
|
47
|
-
newRange.setStart(anchorNode, offset);
|
|
48
|
-
newRange.setEnd(anchorNode, offset);
|
|
49
|
-
selection.removeAllRanges();
|
|
50
|
-
selection.addRange(newRange);
|
|
51
|
-
} else {
|
|
52
|
-
// eslint-disable-next-line no-param-reassign
|
|
53
|
-
editorElement.innerText += text;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.insertTextAtCursorPosition = insertTextAtCursorPosition;
|
|
57
|
-
//# sourceMappingURL=insert.js.map
|
package/lib/utils/insert.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insert.js","names":["insertTextAtCursorPosition","_ref","editorElement","text","selection","window","getSelection","anchorNode","contains","endOffset","startOffset","getRangeAt","rangeDistance","offset","length","nodeValue","substring","newTextNode","document","createTextNode","appendChild","newRange","createRange","Math","min","setStart","setEnd","removeAllRanges","addRange","innerText","exports"],"sources":["../../src/utils/insert.ts"],"sourcesContent":["interface InsertTextAtCursorPositionOptions {\n editorElement: HTMLDivElement;\n text: string;\n}\n\n/**\n * This function inserts the passed text at the correct position in the editor element. If the\n * element has the focus, the new emoji is inserted at the cursor position. If not, the emoji\n * will be appended to the back of the input field content.\n *\n * In addition, this function also sets the cursor to the correct position when the input field\n * has the focus. For this purpose, the current position of the cursor or a selection is read to\n * calculate the cursor position after inserting the text.\n *\n * @param {Object} options - Object with element and text to insert\n * @param {HTMLDivElement} options.editorElement - Element to insert text into\n * @param {string} options.text - Text to insert into element\n */\nexport const insertTextAtCursorPosition = ({\n editorElement,\n text,\n}: InsertTextAtCursorPositionOptions) => {\n const selection = window.getSelection();\n\n if (selection?.anchorNode && editorElement.contains(selection.anchorNode)) {\n const { endOffset, startOffset } = selection.getRangeAt(0);\n\n const rangeDistance = endOffset - startOffset;\n\n let offset = endOffset + text.length - rangeDistance;\n\n let { anchorNode } = selection;\n\n if (anchorNode.nodeValue) {\n anchorNode.nodeValue =\n anchorNode.nodeValue.substring(0, startOffset) +\n text +\n anchorNode.nodeValue.substring(endOffset);\n } else if (anchorNode === editorElement) {\n const newTextNode = document.createTextNode(text);\n\n editorElement.appendChild(newTextNode);\n\n anchorNode = newTextNode;\n }\n\n const newRange = document.createRange();\n\n if (anchorNode.nodeValue) {\n offset = Math.min(offset, anchorNode.nodeValue.length);\n }\n\n newRange.setStart(anchorNode, offset);\n newRange.setEnd(anchorNode, offset);\n\n selection.removeAllRanges();\n selection.addRange(newRange);\n } else {\n // eslint-disable-next-line no-param-reassign\n editorElement.innerText += text;\n }\n};\n"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,0BAA0B,GAAGC,IAAA,IAGD;EAAA,IAHE;IACvCC,aAAa;IACbC;EAC+B,CAAC,GAAAF,IAAA;EAChC,MAAMG,SAAS,GAAGC,MAAM,CAACC,YAAY,EAAE;EAEvC,IAAIF,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEG,UAAU,IAAIL,aAAa,CAACM,QAAQ,CAACJ,SAAS,CAACG,UAAU,CAAC,EAAE;IACvE,MAAM;MAAEE,SAAS;MAAEC;IAAY,CAAC,GAAGN,SAAS,CAACO,UAAU,CAAC,CAAC,CAAC;IAE1D,MAAMC,aAAa,GAAGH,SAAS,GAAGC,WAAW;IAE7C,IAAIG,MAAM,GAAGJ,SAAS,GAAGN,IAAI,CAACW,MAAM,GAAGF,aAAa;IAEpD,IAAI;MAAEL;IAAW,CAAC,GAAGH,SAAS;IAE9B,IAAIG,UAAU,CAACQ,SAAS,EAAE;MACtBR,UAAU,CAACQ,SAAS,GAChBR,UAAU,CAACQ,SAAS,CAACC,SAAS,CAAC,CAAC,EAAEN,WAAW,CAAC,GAC9CP,IAAI,GACJI,UAAU,CAACQ,SAAS,CAACC,SAAS,CAACP,SAAS,CAAC;IACjD,CAAC,MAAM,IAAIF,UAAU,KAAKL,aAAa,EAAE;MACrC,MAAMe,WAAW,GAAGC,QAAQ,CAACC,cAAc,CAAChB,IAAI,CAAC;MAEjDD,aAAa,CAACkB,WAAW,CAACH,WAAW,CAAC;MAEtCV,UAAU,GAAGU,WAAW;IAC5B;IAEA,MAAMI,QAAQ,GAAGH,QAAQ,CAACI,WAAW,EAAE;IAEvC,IAAIf,UAAU,CAACQ,SAAS,EAAE;MACtBF,MAAM,GAAGU,IAAI,CAACC,GAAG,CAACX,MAAM,EAAEN,UAAU,CAACQ,SAAS,CAACD,MAAM,CAAC;IAC1D;IAEAO,QAAQ,CAACI,QAAQ,CAAClB,UAAU,EAAEM,MAAM,CAAC;IACrCQ,QAAQ,CAACK,MAAM,CAACnB,UAAU,EAAEM,MAAM,CAAC;IAEnCT,SAAS,CAACuB,eAAe,EAAE;IAC3BvB,SAAS,CAACwB,QAAQ,CAACP,QAAQ,CAAC;EAChC,CAAC,MAAM;IACH;IACAnB,aAAa,CAAC2B,SAAS,IAAI1B,IAAI;EACnC;AACJ,CAAC;AAAC2B,OAAA,CAAA9B,0BAAA,GAAAA,0BAAA"}
|
package/lib/utils/selection.d.ts
DELETED
package/lib/utils/selection.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.saveSelection = exports.restoreSelection = void 0;
|
|
7
|
-
let childIndex = -1;
|
|
8
|
-
let endOffset = -1;
|
|
9
|
-
let startOffset = -1;
|
|
10
|
-
const saveSelection = element => {
|
|
11
|
-
const selection = window.getSelection();
|
|
12
|
-
if (!selection) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const node = selection.anchorNode;
|
|
16
|
-
if (!node) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const range = selection.getRangeAt(0);
|
|
20
|
-
childIndex = Array.from(element.childNodes).indexOf(node);
|
|
21
|
-
endOffset = range.endOffset;
|
|
22
|
-
startOffset = range.startOffset;
|
|
23
|
-
};
|
|
24
|
-
exports.saveSelection = saveSelection;
|
|
25
|
-
const restoreSelection = element => {
|
|
26
|
-
const childNode = element.childNodes[childIndex];
|
|
27
|
-
const selection = window.getSelection();
|
|
28
|
-
if (!childNode || !element || !selection) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const range = document.createRange();
|
|
32
|
-
if (childNode.nodeValue) {
|
|
33
|
-
endOffset = Math.min(endOffset, childNode.nodeValue.length);
|
|
34
|
-
startOffset = Math.min(startOffset, childNode.nodeValue.length);
|
|
35
|
-
}
|
|
36
|
-
range.setStart(childNode, startOffset);
|
|
37
|
-
range.setEnd(childNode, endOffset);
|
|
38
|
-
selection.removeAllRanges();
|
|
39
|
-
selection.addRange(range);
|
|
40
|
-
range.collapse(true);
|
|
41
|
-
};
|
|
42
|
-
exports.restoreSelection = restoreSelection;
|
|
43
|
-
//# sourceMappingURL=selection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selection.js","names":["childIndex","endOffset","startOffset","saveSelection","element","selection","window","getSelection","node","anchorNode","range","getRangeAt","Array","from","childNodes","indexOf","exports","restoreSelection","childNode","document","createRange","nodeValue","Math","min","length","setStart","setEnd","removeAllRanges","addRange","collapse"],"sources":["../../src/utils/selection.ts"],"sourcesContent":["let childIndex = -1;\nlet endOffset = -1;\nlet startOffset = -1;\n\nexport const saveSelection = (element: HTMLDivElement) => {\n const selection = window.getSelection();\n\n if (!selection) {\n return;\n }\n\n const node = selection.anchorNode;\n\n if (!node) {\n return;\n }\n\n const range = selection.getRangeAt(0);\n\n childIndex = Array.from(element.childNodes).indexOf(node as ChildNode);\n\n endOffset = range.endOffset;\n startOffset = range.startOffset;\n};\n\nexport const restoreSelection = (element: HTMLDivElement) => {\n const childNode = element.childNodes[childIndex];\n const selection = window.getSelection();\n\n if (!childNode || !element || !selection) {\n return;\n }\n\n const range = document.createRange();\n\n if (childNode.nodeValue) {\n endOffset = Math.min(endOffset, childNode.nodeValue.length);\n startOffset = Math.min(startOffset, childNode.nodeValue.length);\n }\n\n range.setStart(childNode, startOffset);\n range.setEnd(childNode, endOffset);\n\n selection.removeAllRanges();\n selection.addRange(range);\n\n range.collapse(true);\n};\n"],"mappings":";;;;;;AAAA,IAAIA,UAAU,GAAG,CAAC,CAAC;AACnB,IAAIC,SAAS,GAAG,CAAC,CAAC;AAClB,IAAIC,WAAW,GAAG,CAAC,CAAC;AAEb,MAAMC,aAAa,GAAIC,OAAuB,IAAK;EACtD,MAAMC,SAAS,GAAGC,MAAM,CAACC,YAAY,EAAE;EAEvC,IAAI,CAACF,SAAS,EAAE;IACZ;EACJ;EAEA,MAAMG,IAAI,GAAGH,SAAS,CAACI,UAAU;EAEjC,IAAI,CAACD,IAAI,EAAE;IACP;EACJ;EAEA,MAAME,KAAK,GAAGL,SAAS,CAACM,UAAU,CAAC,CAAC,CAAC;EAErCX,UAAU,GAAGY,KAAK,CAACC,IAAI,CAACT,OAAO,CAACU,UAAU,CAAC,CAACC,OAAO,CAACP,IAAI,CAAc;EAEtEP,SAAS,GAAGS,KAAK,CAACT,SAAS;EAC3BC,WAAW,GAAGQ,KAAK,CAACR,WAAW;AACnC,CAAC;AAACc,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAEK,MAAMc,gBAAgB,GAAIb,OAAuB,IAAK;EACzD,MAAMc,SAAS,GAAGd,OAAO,CAACU,UAAU,CAACd,UAAU,CAAC;EAChD,MAAMK,SAAS,GAAGC,MAAM,CAACC,YAAY,EAAE;EAEvC,IAAI,CAACW,SAAS,IAAI,CAACd,OAAO,IAAI,CAACC,SAAS,EAAE;IACtC;EACJ;EAEA,MAAMK,KAAK,GAAGS,QAAQ,CAACC,WAAW,EAAE;EAEpC,IAAIF,SAAS,CAACG,SAAS,EAAE;IACrBpB,SAAS,GAAGqB,IAAI,CAACC,GAAG,CAACtB,SAAS,EAAEiB,SAAS,CAACG,SAAS,CAACG,MAAM,CAAC;IAC3DtB,WAAW,GAAGoB,IAAI,CAACC,GAAG,CAACrB,WAAW,EAAEgB,SAAS,CAACG,SAAS,CAACG,MAAM,CAAC;EACnE;EAEAd,KAAK,CAACe,QAAQ,CAACP,SAAS,EAAEhB,WAAW,CAAC;EACtCQ,KAAK,CAACgB,MAAM,CAACR,SAAS,EAAEjB,SAAS,CAAC;EAElCI,SAAS,CAACsB,eAAe,EAAE;EAC3BtB,SAAS,CAACuB,QAAQ,CAAClB,KAAK,CAAC;EAEzBA,KAAK,CAACmB,QAAQ,CAAC,IAAI,CAAC;AACxB,CAAC;AAACb,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|