@atlaskit/emoji 67.0.7 → 67.2.0
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/CHANGELOG.md +37 -0
- package/dist/cjs/api/EmojiResource.js +41 -25
- package/dist/cjs/api/media/TokenManager.js +4 -4
- package/dist/cjs/components/common/CachingEmoji.js +14 -6
- package/dist/cjs/components/common/Emoji.js +48 -12
- package/dist/cjs/components/common/EmojiActions.js +62 -26
- package/dist/cjs/components/common/EmojiErrorMessage.js +12 -7
- package/dist/cjs/components/common/EmojiPlaceholder.js +1 -0
- package/dist/cjs/components/common/{EmojiButton.js → EmojiRadioButton.js} +28 -19
- package/dist/cjs/components/common/EmojiUploadPicker.js +80 -37
- package/dist/cjs/components/common/EmojiUploadPreview.js +11 -2
- package/dist/cjs/components/common/FileChooser.js +2 -2
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/cjs/components/common/RetryableButton.js +7 -3
- package/dist/cjs/components/common/TonePreviewButton.js +44 -0
- package/dist/cjs/components/common/ToneSelector.js +53 -25
- package/dist/cjs/components/common/styles.js +45 -16
- package/dist/cjs/components/i18n.js +44 -4
- package/dist/cjs/components/picker/CategorySelector.js +112 -90
- package/dist/cjs/components/picker/CategoryTracker.js +0 -28
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +2 -1
- package/dist/cjs/components/picker/EmojiPickerComponent.js +33 -44
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/cjs/components/picker/EmojiPickerList.js +154 -88
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +66 -117
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/cjs/components/picker/VirtualList.js +273 -171
- package/dist/cjs/components/picker/styles.js +43 -51
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/cjs/context/EmojiPickerListContext.js +33 -0
- package/dist/cjs/hooks/useEmojiPickerListContext.js +12 -0
- package/dist/cjs/hooks/useIsMounted.js +17 -0
- package/dist/cjs/i18n/cs.js +35 -34
- package/dist/cjs/i18n/da.js +35 -34
- package/dist/cjs/i18n/de.js +35 -34
- package/dist/cjs/i18n/en.js +35 -34
- package/dist/cjs/i18n/en_GB.js +35 -34
- package/dist/cjs/i18n/es.js +35 -34
- package/dist/cjs/i18n/fi.js +35 -34
- package/dist/cjs/i18n/fr.js +35 -34
- package/dist/cjs/i18n/hu.js +35 -34
- package/dist/cjs/i18n/it.js +35 -34
- package/dist/cjs/i18n/ja.js +35 -34
- package/dist/cjs/i18n/ko.js +35 -34
- package/dist/cjs/i18n/nb.js +35 -34
- package/dist/cjs/i18n/nl.js +35 -34
- package/dist/cjs/i18n/pl.js +35 -34
- package/dist/cjs/i18n/pt_BR.js +35 -34
- package/dist/cjs/i18n/ru.js +35 -34
- package/dist/cjs/i18n/sv.js +35 -34
- package/dist/cjs/i18n/th.js +35 -34
- package/dist/cjs/i18n/tr.js +35 -34
- package/dist/cjs/i18n/uk.js +35 -34
- package/dist/cjs/i18n/vi.js +35 -34
- package/dist/cjs/i18n/zh.js +35 -34
- package/dist/cjs/i18n/zh_TW.js +35 -34
- package/dist/cjs/types.js +7 -1
- package/dist/cjs/util/constants.js +43 -2
- package/dist/cjs/util/shared-styles.js +3 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiResource.js +42 -26
- package/dist/es2019/api/media/TokenManager.js +4 -4
- package/dist/es2019/components/common/CachingEmoji.js +10 -3
- package/dist/es2019/components/common/Emoji.js +44 -11
- package/dist/es2019/components/common/EmojiActions.js +55 -24
- package/dist/es2019/components/common/EmojiErrorMessage.js +7 -3
- package/dist/es2019/components/common/EmojiPlaceholder.js +1 -0
- package/dist/es2019/components/common/EmojiRadioButton.js +54 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +75 -36
- package/dist/es2019/components/common/EmojiUploadPreview.js +11 -2
- package/dist/es2019/components/common/FileChooser.js +1 -1
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/es2019/components/common/RetryableButton.js +7 -3
- package/dist/es2019/components/common/TonePreviewButton.js +34 -0
- package/dist/es2019/components/common/ToneSelector.js +55 -21
- package/dist/es2019/components/common/styles.js +41 -10
- package/dist/es2019/components/i18n.js +44 -4
- package/dist/es2019/components/picker/CategorySelector.js +114 -89
- package/dist/es2019/components/picker/CategoryTracker.js +0 -24
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +36 -46
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +51 -21
- package/dist/es2019/components/picker/EmojiPickerList.js +113 -55
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +61 -98
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +4 -1
- package/dist/es2019/components/picker/VirtualList.js +247 -108
- package/dist/es2019/components/picker/styles.js +20 -28
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/es2019/context/EmojiPickerListContext.js +17 -0
- package/dist/es2019/hooks/useEmojiPickerListContext.js +3 -0
- package/dist/es2019/hooks/useIsMounted.js +11 -0
- package/dist/es2019/i18n/cs.js +35 -34
- package/dist/es2019/i18n/da.js +35 -34
- package/dist/es2019/i18n/de.js +35 -34
- package/dist/es2019/i18n/en.js +35 -34
- package/dist/es2019/i18n/en_GB.js +35 -34
- package/dist/es2019/i18n/es.js +35 -34
- package/dist/es2019/i18n/fi.js +35 -34
- package/dist/es2019/i18n/fr.js +35 -34
- package/dist/es2019/i18n/hu.js +35 -34
- package/dist/es2019/i18n/it.js +35 -34
- package/dist/es2019/i18n/ja.js +35 -34
- package/dist/es2019/i18n/ko.js +35 -34
- package/dist/es2019/i18n/nb.js +35 -34
- package/dist/es2019/i18n/nl.js +35 -34
- package/dist/es2019/i18n/pl.js +35 -34
- package/dist/es2019/i18n/pt_BR.js +35 -34
- package/dist/es2019/i18n/ru.js +35 -34
- package/dist/es2019/i18n/sv.js +35 -34
- package/dist/es2019/i18n/th.js +35 -34
- package/dist/es2019/i18n/tr.js +35 -34
- package/dist/es2019/i18n/uk.js +35 -34
- package/dist/es2019/i18n/vi.js +35 -34
- package/dist/es2019/i18n/zh.js +35 -34
- package/dist/es2019/i18n/zh_TW.js +35 -34
- package/dist/es2019/types.js +5 -0
- package/dist/es2019/util/constants.js +32 -0
- package/dist/es2019/util/shared-styles.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiResource.js +42 -26
- package/dist/esm/api/media/TokenManager.js +4 -4
- package/dist/esm/components/common/CachingEmoji.js +14 -6
- package/dist/esm/components/common/Emoji.js +48 -12
- package/dist/esm/components/common/EmojiActions.js +62 -26
- package/dist/esm/components/common/EmojiErrorMessage.js +7 -3
- package/dist/esm/components/common/EmojiPlaceholder.js +1 -0
- package/dist/esm/components/common/EmojiRadioButton.js +52 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +77 -36
- package/dist/esm/components/common/EmojiUploadPreview.js +11 -2
- package/dist/esm/components/common/FileChooser.js +1 -1
- package/dist/esm/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/esm/components/common/RetryableButton.js +7 -3
- package/dist/esm/components/common/TonePreviewButton.js +33 -0
- package/dist/esm/components/common/ToneSelector.js +49 -18
- package/dist/esm/components/common/styles.js +40 -12
- package/dist/esm/components/i18n.js +44 -4
- package/dist/esm/components/picker/CategorySelector.js +114 -95
- package/dist/esm/components/picker/CategoryTracker.js +0 -28
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +35 -46
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/esm/components/picker/EmojiPickerList.js +156 -86
- package/dist/esm/components/picker/EmojiPickerListSearch.js +64 -117
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/esm/components/picker/VirtualList.js +274 -172
- package/dist/esm/components/picker/styles.js +37 -45
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/esm/context/EmojiPickerListContext.js +21 -0
- package/dist/esm/hooks/useEmojiPickerListContext.js +5 -0
- package/dist/esm/hooks/useIsMounted.js +11 -0
- package/dist/esm/i18n/cs.js +35 -34
- package/dist/esm/i18n/da.js +35 -34
- package/dist/esm/i18n/de.js +35 -34
- package/dist/esm/i18n/en.js +35 -34
- package/dist/esm/i18n/en_GB.js +35 -34
- package/dist/esm/i18n/es.js +35 -34
- package/dist/esm/i18n/fi.js +35 -34
- package/dist/esm/i18n/fr.js +35 -34
- package/dist/esm/i18n/hu.js +35 -34
- package/dist/esm/i18n/it.js +35 -34
- package/dist/esm/i18n/ja.js +35 -34
- package/dist/esm/i18n/ko.js +35 -34
- package/dist/esm/i18n/nb.js +35 -34
- package/dist/esm/i18n/nl.js +35 -34
- package/dist/esm/i18n/pl.js +35 -34
- package/dist/esm/i18n/pt_BR.js +35 -34
- package/dist/esm/i18n/ru.js +35 -34
- package/dist/esm/i18n/sv.js +35 -34
- package/dist/esm/i18n/th.js +35 -34
- package/dist/esm/i18n/tr.js +35 -34
- package/dist/esm/i18n/uk.js +35 -34
- package/dist/esm/i18n/vi.js +35 -34
- package/dist/esm/i18n/zh.js +35 -34
- package/dist/esm/i18n/zh_TW.js +35 -34
- package/dist/esm/types.js +5 -0
- package/dist/esm/util/constants.js +32 -0
- package/dist/esm/util/shared-styles.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/api/EmojiResource.d.ts +2 -0
- package/dist/types/components/common/Emoji.d.ts +7 -1
- package/dist/types/components/common/EmojiActions.d.ts +4 -3
- package/dist/types/components/common/{EmojiButton.d.ts → EmojiRadioButton.d.ts} +3 -4
- package/dist/types/components/common/EmojiUploadPicker.d.ts +6 -4
- package/dist/types/components/common/RetryableButton.d.ts +1 -0
- package/dist/types/components/common/TonePreviewButton.d.ts +14 -0
- package/dist/types/components/common/ToneSelector.d.ts +8 -5
- package/dist/types/components/common/internal-types.d.ts +9 -0
- package/dist/types/components/common/styles.d.ts +2 -1
- package/dist/types/components/i18n.d.ts +40 -0
- package/dist/types/components/picker/CategorySelector.d.ts +3 -10
- package/dist/types/components/picker/CategoryTracker.d.ts +0 -2
- package/dist/types/components/picker/EmojiPickerCategoryHeading.d.ts +2 -1
- package/dist/types/components/picker/EmojiPickerEmojiRow.d.ts +5 -0
- package/dist/types/components/picker/EmojiPickerList.d.ts +14 -7
- package/dist/types/components/picker/EmojiPickerListSearch.d.ts +4 -8
- package/dist/types/components/picker/EmojiPickerVirtualItems.d.ts +1 -1
- package/dist/types/components/picker/VirtualList.d.ts +7 -24
- package/dist/types/components/picker/styles.d.ts +1 -1
- package/dist/types/context/EmojiPickerListContext.d.ts +10 -0
- package/dist/types/hooks/useEmojiPickerListContext.d.ts +1 -0
- package/dist/types/hooks/useIsMounted.d.ts +1 -0
- package/dist/types/i18n/cs.d.ts +34 -34
- package/dist/types/i18n/da.d.ts +34 -34
- package/dist/types/i18n/de.d.ts +34 -34
- package/dist/types/i18n/en.d.ts +34 -34
- package/dist/types/i18n/en_GB.d.ts +34 -34
- package/dist/types/i18n/es.d.ts +34 -34
- package/dist/types/i18n/fi.d.ts +34 -34
- package/dist/types/i18n/fr.d.ts +34 -34
- package/dist/types/i18n/hu.d.ts +34 -34
- package/dist/types/i18n/it.d.ts +34 -34
- package/dist/types/i18n/ja.d.ts +34 -34
- package/dist/types/i18n/ko.d.ts +34 -34
- package/dist/types/i18n/nb.d.ts +34 -34
- package/dist/types/i18n/nl.d.ts +34 -34
- package/dist/types/i18n/pl.d.ts +34 -34
- package/dist/types/i18n/pt_BR.d.ts +34 -34
- package/dist/types/i18n/ru.d.ts +34 -34
- package/dist/types/i18n/sv.d.ts +34 -34
- package/dist/types/i18n/th.d.ts +34 -34
- package/dist/types/i18n/tr.d.ts +34 -34
- package/dist/types/i18n/uk.d.ts +34 -34
- package/dist/types/i18n/vi.d.ts +34 -34
- package/dist/types/i18n/zh.d.ts +34 -34
- package/dist/types/i18n/zh_TW.d.ts +34 -34
- package/dist/types/types.d.ts +5 -0
- package/dist/types/util/constants.d.ts +28 -0
- package/dist/types/util/shared-styles.d.ts +1 -1
- package/dist/types/util/type-helpers.d.ts +1 -1
- package/package.json +12 -8
- package/report.api.md +62 -1
- package/README.md +0 -3
- package/dist/cjs/components/hooks.js +0 -14
- package/dist/es2019/components/common/EmojiButton.js +0 -49
- package/dist/es2019/components/hooks.js +0 -8
- package/dist/esm/components/common/EmojiButton.js +0 -43
- package/dist/esm/components/hooks.js +0 -8
- package/dist/types/components/hooks.d.ts +0 -1
package/dist/cjs/i18n/vi.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* prettier-ignore */
|
|
7
8
|
/**
|
|
8
9
|
* NOTE:
|
|
9
10
|
*
|
|
@@ -12,39 +13,39 @@ exports.default = void 0;
|
|
|
12
13
|
*/
|
|
13
14
|
//Vietnamese (Vietnam)
|
|
14
15
|
var _default = {
|
|
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
|
-
|
|
16
|
+
"fabric.emoji.add.custom.emoji.label": "Thêm biểu tượng cảm xúc của riêng bạn",
|
|
17
|
+
"fabric.emoji.add.label": "Thêm biểu tượng cảm xúc",
|
|
18
|
+
"fabric.emoji.cancel.label": "Hủy",
|
|
19
|
+
"fabric.emoji.categories.search.results": "Kết quả tìm kiếm",
|
|
20
|
+
"fabric.emoji.category.activity": "Hoạt động",
|
|
21
|
+
"fabric.emoji.category.all.uploads": "Tất cả các nội dung tải lên",
|
|
22
|
+
"fabric.emoji.category.flags": "Cờ",
|
|
23
|
+
"fabric.emoji.category.foods": "Thực phẩm & Đồ uống",
|
|
24
|
+
"fabric.emoji.category.frequent": "Thường ngày",
|
|
25
|
+
"fabric.emoji.category.nature": "Thiên nhiên",
|
|
26
|
+
"fabric.emoji.category.objects": "Đồ vật",
|
|
27
|
+
"fabric.emoji.category.people": "Mọi người",
|
|
28
|
+
"fabric.emoji.category.places": "Du lịch & Địa điểm",
|
|
29
|
+
"fabric.emoji.category.productivity": "Năng suất",
|
|
30
|
+
"fabric.emoji.category.symbols": "Biểu tượng",
|
|
31
|
+
"fabric.emoji.category.user.uploads": "Các nội dung bạn tải lên",
|
|
32
|
+
"fabric.emoji.choose.file.screenReaderDescription": "Chọn một tệp cho biểu tượng cảm xúc. JPG, PNG hoặc GIF. Kích thước tối đa 1 MB.",
|
|
33
|
+
"fabric.emoji.choose.file.title": "Chọn tập tin",
|
|
34
|
+
"fabric.emoji.delete.description": "Tất cả các phiên bản hiện tại của biểu tượng cảm xúc này sẽ được thay thế bằng {emojiShortName}",
|
|
35
|
+
"fabric.emoji.delete.label": "Xóa",
|
|
36
|
+
"fabric.emoji.delete.title": "Xóa biểu tượng cảm xúc",
|
|
37
|
+
"fabric.emoji.error.delete.failed": "Không xóa được",
|
|
38
|
+
"fabric.emoji.error.image.too.big": "Hình ảnh đã chọn có kích thước lớn hơn 1 MB",
|
|
39
|
+
"fabric.emoji.error.invalid.image": "Hình ảnh đã chọn không hợp lệ",
|
|
40
|
+
"fabric.emoji.error.upload.failed": "Không thể tải lên",
|
|
41
|
+
"fabric.emoji.image.requirements": "JPG, PNG hoặc GIF. Kích thước tối đa 1 MB.",
|
|
42
|
+
"fabric.emoji.name.ariaLabel": "Nhập tên cho biểu tượng cảm xúc mới này",
|
|
43
|
+
"fabric.emoji.placeholder": "Tên biểu tượng cảm xúc",
|
|
44
|
+
"fabric.emoji.preview": "Biểu tượng cảm xúc mới của bạn {emoji} trông rất tuyệt",
|
|
45
|
+
"fabric.emoji.preview.title": "Xem trước",
|
|
46
|
+
"fabric.emoji.retry.label": "Thử lại",
|
|
47
|
+
"fabric.emoji.search.label": "Tìm kiếm biểu tượng cảm xúc",
|
|
48
|
+
"fabric.emoji.search.placeholder": "Tìm kiếm",
|
|
49
|
+
"fabric.emoji.select.skin.tone.ariaLabel": "Chọn tông màu da, {selectedTone}"
|
|
49
50
|
};
|
|
50
51
|
exports.default = _default;
|
package/dist/cjs/i18n/zh.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* prettier-ignore */
|
|
7
8
|
/**
|
|
8
9
|
* NOTE:
|
|
9
10
|
*
|
|
@@ -12,39 +13,39 @@ exports.default = void 0;
|
|
|
12
13
|
*/
|
|
13
14
|
//Chinese (Simplified)
|
|
14
15
|
var _default = {
|
|
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
|
-
|
|
16
|
+
"fabric.emoji.add.custom.emoji.label": "添加您自己的表情符号",
|
|
17
|
+
"fabric.emoji.add.label": "添加表情符号",
|
|
18
|
+
"fabric.emoji.cancel.label": "取消",
|
|
19
|
+
"fabric.emoji.categories.search.results": "搜索结果",
|
|
20
|
+
"fabric.emoji.category.activity": "活动",
|
|
21
|
+
"fabric.emoji.category.all.uploads": "所有上传",
|
|
22
|
+
"fabric.emoji.category.flags": "标记",
|
|
23
|
+
"fabric.emoji.category.foods": "食物和饮品",
|
|
24
|
+
"fabric.emoji.category.frequent": "频率",
|
|
25
|
+
"fabric.emoji.category.nature": "性质",
|
|
26
|
+
"fabric.emoji.category.objects": "对象",
|
|
27
|
+
"fabric.emoji.category.people": "人员",
|
|
28
|
+
"fabric.emoji.category.places": "旅行和地点",
|
|
29
|
+
"fabric.emoji.category.productivity": "生产力",
|
|
30
|
+
"fabric.emoji.category.symbols": "符号",
|
|
31
|
+
"fabric.emoji.category.user.uploads": "您的上传",
|
|
32
|
+
"fabric.emoji.choose.file.screenReaderDescription": "为表情符号选择一个文件。JPG、PNG 或 GIF。文件大小不得超过 1 MB。",
|
|
33
|
+
"fabric.emoji.choose.file.title": "选择文件",
|
|
34
|
+
"fabric.emoji.delete.description": "此表情符号的所有现有实例将替换为{emojiShortName}",
|
|
35
|
+
"fabric.emoji.delete.label": "删除",
|
|
36
|
+
"fabric.emoji.delete.title": "删除表情符号",
|
|
37
|
+
"fabric.emoji.error.delete.failed": "删除失败",
|
|
38
|
+
"fabric.emoji.error.image.too.big": "选择的图像超过 1 MB",
|
|
39
|
+
"fabric.emoji.error.invalid.image": "选择的图像无效",
|
|
40
|
+
"fabric.emoji.error.upload.failed": "上传失败",
|
|
41
|
+
"fabric.emoji.image.requirements": "JPG、PNG 或 GIF 最大为 1 MB。",
|
|
42
|
+
"fabric.emoji.name.ariaLabel": "为新表情符号输入名称",
|
|
43
|
+
"fabric.emoji.placeholder": "表情符号名称",
|
|
44
|
+
"fabric.emoji.preview": "您的新表情符号{emoji}看起来很棒",
|
|
45
|
+
"fabric.emoji.preview.title": "预览",
|
|
46
|
+
"fabric.emoji.retry.label": "重试",
|
|
47
|
+
"fabric.emoji.search.label": "搜索表情",
|
|
48
|
+
"fabric.emoji.search.placeholder": "搜索",
|
|
49
|
+
"fabric.emoji.select.skin.tone.ariaLabel": "选择肤色,{selectedTone}"
|
|
49
50
|
};
|
|
50
51
|
exports.default = _default;
|
package/dist/cjs/i18n/zh_TW.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* prettier-ignore */
|
|
7
8
|
/**
|
|
8
9
|
* NOTE:
|
|
9
10
|
*
|
|
@@ -12,39 +13,39 @@ exports.default = void 0;
|
|
|
12
13
|
*/
|
|
13
14
|
//Chinese (Traditional)
|
|
14
15
|
var _default = {
|
|
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
|
-
|
|
16
|
+
"fabric.emoji.add.custom.emoji.label": "新增專屬的表情符號",
|
|
17
|
+
"fabric.emoji.add.label": "新增表情符號",
|
|
18
|
+
"fabric.emoji.cancel.label": "取消",
|
|
19
|
+
"fabric.emoji.categories.search.results": "搜尋結果",
|
|
20
|
+
"fabric.emoji.category.activity": "活動",
|
|
21
|
+
"fabric.emoji.category.all.uploads": "所有上傳項目",
|
|
22
|
+
"fabric.emoji.category.flags": "旗標",
|
|
23
|
+
"fabric.emoji.category.foods": "食物和飲料",
|
|
24
|
+
"fabric.emoji.category.frequent": "常用項目",
|
|
25
|
+
"fabric.emoji.category.nature": "自然",
|
|
26
|
+
"fabric.emoji.category.objects": "物體",
|
|
27
|
+
"fabric.emoji.category.people": "人員",
|
|
28
|
+
"fabric.emoji.category.places": "旅遊和地點",
|
|
29
|
+
"fabric.emoji.category.productivity": "生產力",
|
|
30
|
+
"fabric.emoji.category.symbols": "符號",
|
|
31
|
+
"fabric.emoji.category.user.uploads": "您的上傳項目",
|
|
32
|
+
"fabric.emoji.choose.file.screenReaderDescription": "請選擇表情符號的檔案。JPG、PNG 或 GIF。大小上限為 1 MB。",
|
|
33
|
+
"fabric.emoji.choose.file.title": "選擇檔案",
|
|
34
|
+
"fabric.emoji.delete.description": "此表情符號的所有現有執行個體都將取代為 {emojiShortName}",
|
|
35
|
+
"fabric.emoji.delete.label": "移除",
|
|
36
|
+
"fabric.emoji.delete.title": "移除表情符號",
|
|
37
|
+
"fabric.emoji.error.delete.failed": "移除失敗",
|
|
38
|
+
"fabric.emoji.error.image.too.big": "所選的影像超過 1 MB",
|
|
39
|
+
"fabric.emoji.error.invalid.image": "所選的影像無效",
|
|
40
|
+
"fabric.emoji.error.upload.failed": "上傳失敗",
|
|
41
|
+
"fabric.emoji.image.requirements": "JPG、PNG 或 GIF。大小上限為 1 MB。",
|
|
42
|
+
"fabric.emoji.name.ariaLabel": "請輸入新表情符號的名稱",
|
|
43
|
+
"fabric.emoji.placeholder": "表情符號名稱",
|
|
44
|
+
"fabric.emoji.preview": "新的表情符號 {emoji} 看起來很棒",
|
|
45
|
+
"fabric.emoji.preview.title": "預覽",
|
|
46
|
+
"fabric.emoji.retry.label": "重試",
|
|
47
|
+
"fabric.emoji.search.label": "搜尋表情符號",
|
|
48
|
+
"fabric.emoji.search.placeholder": "搜尋",
|
|
49
|
+
"fabric.emoji.select.skin.tone.ariaLabel": "選取膚色,{selectedTone}"
|
|
49
50
|
};
|
|
50
51
|
exports.default = _default;
|
package/dist/cjs/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.UfoExperienceName = exports.UfoEmojiTimingsKeys = exports.UfoEmojiTimings = exports.UfoComponentName = exports.SearchSort = exports.ProviderTypes = void 0;
|
|
6
|
+
exports.UfoExperienceName = exports.UfoEmojiTimingsKeys = exports.UfoEmojiTimings = exports.UfoComponentName = exports.SearchSourceTypes = exports.SearchSort = exports.ProviderTypes = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Minimum information to defined an emoji is the shortName.
|
|
9
9
|
* In order to uniquely define an emoji, the id should be included, and is
|
|
@@ -35,6 +35,12 @@ exports.SearchSort = SearchSort;
|
|
|
35
35
|
SearchSort[SearchSort["Default"] = 1] = "Default";
|
|
36
36
|
SearchSort[SearchSort["UsageFrequency"] = 2] = "UsageFrequency";
|
|
37
37
|
})(SearchSort || (exports.SearchSort = SearchSort = {}));
|
|
38
|
+
var SearchSourceTypes;
|
|
39
|
+
exports.SearchSourceTypes = SearchSourceTypes;
|
|
40
|
+
(function (SearchSourceTypes) {
|
|
41
|
+
SearchSourceTypes["PICKER"] = "picker";
|
|
42
|
+
SearchSourceTypes["TYPEAHEAD"] = "typeahead";
|
|
43
|
+
})(SearchSourceTypes || (exports.SearchSourceTypes = SearchSourceTypes = {}));
|
|
38
44
|
var ProviderTypes;
|
|
39
45
|
exports.ProviderTypes = ProviderTypes;
|
|
40
46
|
(function (ProviderTypes) {
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.userCustomTitle = exports.sizeGap = exports.selectedToneStorageKey = exports.migrationUserId = exports.localStoragePrefix = exports.frequentCategory = exports.emojiPickerWidth = exports.emojiPickerPreviewHeight = exports.emojiPickerMinHeight = exports.emojiPickerListHeight = exports.emojiPickerHeightWithPreview = exports.emojiPickerHeight = exports.deleteEmojiLabel = exports.defaultListLimit = exports.defaultEmojiPickerSize = exports.defaultEmojiHeight = exports.defaultCategories = exports.dataURLPrefix = exports.customType = exports.customTitle = exports.customCategory = exports.analyticsEmojiPrefix = exports.SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP = exports.SAMPLING_RATE_EMOJI_RENDERED_EXP = exports.MAX_ORDINAL = void 0;
|
|
6
|
+
exports.yourUploadsCategory = exports.userCustomTitle = exports.sizeGap = exports.selectedToneStorageKey = exports.searchCategory = exports.migrationUserId = exports.localStoragePrefix = exports.frequentCategory = exports.emojiPickerWidth = exports.emojiPickerPreviewHeight = exports.emojiPickerMinHeight = exports.emojiPickerListHeight = exports.emojiPickerHeightWithPreview = exports.emojiPickerHeight = exports.deleteEmojiLabel = exports.defaultListLimit = exports.defaultEmojiPickerSize = exports.defaultEmojiHeight = exports.defaultCategories = exports.dataURLPrefix = exports.customType = exports.customTitle = exports.customCategory = exports.analyticsEmojiPrefix = exports.TONESELECTOR_KEYBOARD_KEYS_SUPPORTED = exports.SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP = exports.SAMPLING_RATE_EMOJI_RENDERED_EXP = exports.MAX_ORDINAL = exports.KeyboardNavigationDirection = exports.KeyboardKeys = exports.EMOJI_SEARCH_DEBOUNCE = exports.EMOJI_LIST_PAGE_COUNT = exports.EMOJI_LIST_COLUMNS = exports.EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED = exports.DEFAULT_TONE = exports.CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED = void 0;
|
|
7
7
|
var customCategory = 'CUSTOM';
|
|
8
8
|
exports.customCategory = customCategory;
|
|
9
9
|
var frequentCategory = 'FREQUENT';
|
|
10
10
|
exports.frequentCategory = frequentCategory;
|
|
11
11
|
var customType = 'SITE';
|
|
12
12
|
exports.customType = customType;
|
|
13
|
+
var searchCategory = 'SEARCH';
|
|
14
|
+
exports.searchCategory = searchCategory;
|
|
15
|
+
var yourUploadsCategory = 'USER_CUSTOM';
|
|
16
|
+
exports.yourUploadsCategory = yourUploadsCategory;
|
|
13
17
|
var customTitle = 'allUploadsCustomCategory';
|
|
14
18
|
exports.customTitle = customTitle;
|
|
15
19
|
var userCustomTitle = 'userUploadsCustomCategory';
|
|
@@ -49,14 +53,51 @@ var selectedToneStorageKey = "".concat(localStoragePrefix, ".selectedTone");
|
|
|
49
53
|
exports.selectedToneStorageKey = selectedToneStorageKey;
|
|
50
54
|
var defaultCategories = ['PEOPLE', 'NATURE', 'FOODS', 'ACTIVITY', 'PLACES', 'OBJECTS', 'SYMBOLS', 'FLAGS'];
|
|
51
55
|
exports.defaultCategories = defaultCategories;
|
|
56
|
+
var KeyboardKeys; // Used to search available emoji in the picker list to focus
|
|
57
|
+
exports.KeyboardKeys = KeyboardKeys;
|
|
58
|
+
(function (KeyboardKeys) {
|
|
59
|
+
KeyboardKeys["ArrowLeft"] = "ArrowLeft";
|
|
60
|
+
KeyboardKeys["ArrowRight"] = "ArrowRight";
|
|
61
|
+
KeyboardKeys["ArrowUp"] = "ArrowUp";
|
|
62
|
+
KeyboardKeys["ArrowDown"] = "ArrowDown";
|
|
63
|
+
KeyboardKeys["PageUp"] = "PageUp";
|
|
64
|
+
KeyboardKeys["PageDown"] = "PageDown";
|
|
65
|
+
KeyboardKeys["Home"] = "Home";
|
|
66
|
+
KeyboardKeys["End"] = "End";
|
|
67
|
+
KeyboardKeys["Enter"] = "Enter";
|
|
68
|
+
KeyboardKeys["Tab"] = "Tab";
|
|
69
|
+
KeyboardKeys["Space"] = " ";
|
|
70
|
+
})(KeyboardKeys || (exports.KeyboardKeys = KeyboardKeys = {}));
|
|
71
|
+
var KeyboardNavigationDirection;
|
|
72
|
+
exports.KeyboardNavigationDirection = KeyboardNavigationDirection;
|
|
73
|
+
(function (KeyboardNavigationDirection) {
|
|
74
|
+
KeyboardNavigationDirection["Down"] = "Down";
|
|
75
|
+
KeyboardNavigationDirection["Up"] = "Up";
|
|
76
|
+
KeyboardNavigationDirection["Left"] = "Left";
|
|
77
|
+
KeyboardNavigationDirection["Right"] = "Right";
|
|
78
|
+
})(KeyboardNavigationDirection || (exports.KeyboardNavigationDirection = KeyboardNavigationDirection = {}));
|
|
79
|
+
var CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.ArrowRight, KeyboardKeys.ArrowLeft, KeyboardKeys.Home, KeyboardKeys.End];
|
|
80
|
+
exports.CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED = CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED;
|
|
81
|
+
var TONESELECTOR_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.Enter, KeyboardKeys.Tab, KeyboardKeys.Space];
|
|
82
|
+
exports.TONESELECTOR_KEYBOARD_KEYS_SUPPORTED = TONESELECTOR_KEYBOARD_KEYS_SUPPORTED;
|
|
83
|
+
var EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.ArrowRight, KeyboardKeys.ArrowLeft, KeyboardKeys.Home, KeyboardKeys.End, KeyboardKeys.ArrowUp, KeyboardKeys.ArrowDown, KeyboardKeys.PageUp, KeyboardKeys.PageDown];
|
|
84
|
+
exports.EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED = EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED;
|
|
85
|
+
var DEFAULT_TONE = 0;
|
|
86
|
+
exports.DEFAULT_TONE = DEFAULT_TONE;
|
|
52
87
|
var defaultListLimit = 50;
|
|
53
88
|
exports.defaultListLimit = defaultListLimit;
|
|
54
89
|
var migrationUserId = 'hipchat_migration_emoticons';
|
|
55
90
|
exports.migrationUserId = migrationUserId;
|
|
56
91
|
var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker';
|
|
92
|
+
exports.analyticsEmojiPrefix = analyticsEmojiPrefix;
|
|
93
|
+
var EMOJI_LIST_COLUMNS = 8;
|
|
94
|
+
exports.EMOJI_LIST_COLUMNS = EMOJI_LIST_COLUMNS;
|
|
95
|
+
var EMOJI_LIST_PAGE_COUNT = 5;
|
|
96
|
+
exports.EMOJI_LIST_PAGE_COUNT = EMOJI_LIST_PAGE_COUNT;
|
|
97
|
+
var EMOJI_SEARCH_DEBOUNCE = 150;
|
|
57
98
|
|
|
58
99
|
// This is the base sampling rate in Emoji
|
|
59
|
-
exports.
|
|
100
|
+
exports.EMOJI_SEARCH_DEBOUNCE = EMOJI_SEARCH_DEBOUNCE;
|
|
60
101
|
var SAMPLING_RATE_EMOJI_RENDERED_EXP = 20;
|
|
61
102
|
// This rate is used in fetching emoji resource
|
|
62
103
|
exports.SAMPLING_RATE_EMOJI_RENDERED_EXP = SAMPLING_RATE_EMOJI_RENDERED_EXP;
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.noDialogContainerBoxShadow = exports.noDialogContainerBorderRadius = exports.noDialogContainerBorderColor = exports.emojiTypeAheadWidth = exports.emojiTypeAheadMaxHeight = exports.emojiPreviewSelectedColor = exports.emojiPickerListWidth = exports.emojiPickerListHeight = exports.emojiPickerBoxShadow = exports.emojiPickerBorderColor = exports.akEmojiSelectedBackgroundColor = void 0;
|
|
7
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
8
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
|
-
var
|
|
10
|
-
var emojiPickerListWidth =
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
var emojiPickerListWidth = _constants.emojiPickerWidth;
|
|
11
10
|
exports.emojiPickerListWidth = emojiPickerListWidth;
|
|
12
11
|
var emojiPickerListHeight = 205;
|
|
13
12
|
exports.emojiPickerListHeight = emojiPickerListHeight;
|
|
@@ -17,7 +16,7 @@ var emojiPickerBoxShadow = "var(--ds-shadow-overlay, 0 3px 6px rgba(0, 0, 0, 0.2
|
|
|
17
16
|
exports.emojiPickerBoxShadow = emojiPickerBoxShadow;
|
|
18
17
|
var noDialogContainerBorderColor = "var(--ds-border, ".concat(_colors.N40, ")");
|
|
19
18
|
exports.noDialogContainerBorderColor = noDialogContainerBorderColor;
|
|
20
|
-
var noDialogContainerBorderRadius = "
|
|
19
|
+
var noDialogContainerBorderRadius = "var(--ds-radius-100, 3px)";
|
|
21
20
|
exports.noDialogContainerBorderRadius = noDialogContainerBorderRadius;
|
|
22
21
|
var noDialogContainerBoxShadow = "var(--ds-shadow-overlay, 0 3px 6px rgba(0, 0, 0, 0.2))";
|
|
23
22
|
exports.noDialogContainerBoxShadow = noDialogContainerBoxShadow;
|
package/dist/cjs/version.json
CHANGED
|
@@ -8,7 +8,7 @@ import { ProviderTypes } from '../types';
|
|
|
8
8
|
import EmojiLoader from './EmojiLoader';
|
|
9
9
|
import EmojiRepository from './EmojiRepository';
|
|
10
10
|
import SiteEmojiResource from './media/SiteEmojiResource';
|
|
11
|
-
import { sampledUfoEmojiResourceFetched } from '../util/analytics/ufoExperiences';
|
|
11
|
+
import { sampledUfoEmojiResourceFetched, ufoExperiences } from '../util/analytics/ufoExperiences';
|
|
12
12
|
/**
|
|
13
13
|
* Checks if the emojiProvider can support uploading at a feature level.
|
|
14
14
|
*
|
|
@@ -24,6 +24,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
24
24
|
constructor(config) {
|
|
25
25
|
super();
|
|
26
26
|
_defineProperty(this, "activeLoaders", 0);
|
|
27
|
+
_defineProperty(this, "initialLoaders", 0);
|
|
27
28
|
_defineProperty(this, "retries", new Map());
|
|
28
29
|
_defineProperty(this, "isInitialised", false);
|
|
29
30
|
_defineProperty(this, "getOptimisticImageURL", emojiId => {
|
|
@@ -32,7 +33,10 @@ export class EmojiResource extends AbstractResource {
|
|
|
32
33
|
}
|
|
33
34
|
return;
|
|
34
35
|
});
|
|
35
|
-
_defineProperty(this, "
|
|
36
|
+
_defineProperty(this, "isRepositoryAvailable", repository => {
|
|
37
|
+
return !!repository;
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(this, "isLoaded", () => this.initialLoaders !== 0 && this.activeLoaders === 0);
|
|
36
40
|
this.emojiProviderConfig = config;
|
|
37
41
|
this.recordConfig = config.recordConfig;
|
|
38
42
|
this.currentUser = config.currentUser;
|
|
@@ -42,6 +46,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
42
46
|
if (config.providers.length === 0) {
|
|
43
47
|
throw new Error('No providers specified');
|
|
44
48
|
}
|
|
49
|
+
this.initialLoaders = this.emojiProviderConfig.providers.length;
|
|
45
50
|
this.activeLoaders = this.emojiProviderConfig.providers.length;
|
|
46
51
|
this.emojiResponses = [];
|
|
47
52
|
}
|
|
@@ -102,7 +107,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
102
107
|
// happen if no emojiRepository exists
|
|
103
108
|
// in case this method is called and emojiRepository has already been populated
|
|
104
109
|
// the method will just return the existing emojiRepository
|
|
105
|
-
if (force || !this.emojiRepository && !this.isInitialised) {
|
|
110
|
+
if (force || !this.isRepositoryAvailable(this.emojiRepository) && !this.isInitialised) {
|
|
106
111
|
this.isInitialised = true;
|
|
107
112
|
this.emojiResponses = [];
|
|
108
113
|
// fetch emoji providers
|
|
@@ -112,7 +117,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
112
117
|
}
|
|
113
118
|
async fetchByEmojiId(emojiId, optimistic) {
|
|
114
119
|
// Check if repository exists and emoji is defined.
|
|
115
|
-
if (this.
|
|
120
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
116
121
|
const emoji = await this.findByEmojiId(emojiId);
|
|
117
122
|
if (emoji) {
|
|
118
123
|
return await this.getMediaEmojiDescriptionURLWithInlineToken(emoji);
|
|
@@ -132,7 +137,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
132
137
|
if (!loadEmoji.emojis[0]) {
|
|
133
138
|
return;
|
|
134
139
|
}
|
|
135
|
-
if (!this.siteEmojiResource) {
|
|
140
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
136
141
|
await this.initSiteEmojiResource(loadEmoji, provider);
|
|
137
142
|
}
|
|
138
143
|
return this.getMediaEmojiDescriptionURLWithInlineToken(loadEmoji.emojis[0]);
|
|
@@ -168,7 +173,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
168
173
|
this.emojiRepository = new EmojiRepository(emojis);
|
|
169
174
|
}
|
|
170
175
|
initSiteEmojiResource(emojiResponse, provider) {
|
|
171
|
-
if (!this.siteEmojiResource && emojiResponse.mediaApiToken) {
|
|
176
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource) && emojiResponse.mediaApiToken) {
|
|
172
177
|
this.siteEmojiResource = new SiteEmojiResource(provider, emojiResponse.mediaApiToken);
|
|
173
178
|
|
|
174
179
|
// Prime cache type + optimistic rendering by checking first Emoji.
|
|
@@ -250,7 +255,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
250
255
|
* Returns the EmojiDescription with a valid media path that includes query token and client attributes to access the emoji media inline.
|
|
251
256
|
*/
|
|
252
257
|
async getMediaEmojiDescriptionURLWithInlineToken(emoji) {
|
|
253
|
-
if (this.siteEmojiResource && isMediaRepresentation(emoji.representation)) {
|
|
258
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource) && isMediaRepresentation(emoji.representation)) {
|
|
254
259
|
const tokenisedMediaPath = await this.siteEmojiResource.generateTokenisedMediaURL(emoji);
|
|
255
260
|
return {
|
|
256
261
|
...emoji,
|
|
@@ -263,7 +268,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
263
268
|
return emoji;
|
|
264
269
|
}
|
|
265
270
|
loadMediaEmoji(emoji, useAlt) {
|
|
266
|
-
if (!this.siteEmojiResource || !isMediaEmoji(emoji)) {
|
|
271
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource) || !isMediaEmoji(emoji)) {
|
|
267
272
|
return emoji;
|
|
268
273
|
}
|
|
269
274
|
return this.siteEmojiResource.loadMediaEmoji(emoji, useAlt);
|
|
@@ -272,7 +277,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
272
277
|
if (!isMediaEmoji(emoji)) {
|
|
273
278
|
return true;
|
|
274
279
|
}
|
|
275
|
-
if (!this.siteEmojiResource) {
|
|
280
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
276
281
|
// Shouldn't have a media emoji without a siteEmojiResouce, but anyway ;)
|
|
277
282
|
return false;
|
|
278
283
|
}
|
|
@@ -284,19 +289,30 @@ export class EmojiResource extends AbstractResource {
|
|
|
284
289
|
return optimistic;
|
|
285
290
|
}
|
|
286
291
|
filter(query, options) {
|
|
292
|
+
ufoExperiences['emoji-searched'].start();
|
|
293
|
+
ufoExperiences['emoji-searched'].addMetadata({
|
|
294
|
+
queryLength: (query === null || query === void 0 ? void 0 : query.length) || 0
|
|
295
|
+
});
|
|
287
296
|
this.lastQuery = {
|
|
288
297
|
query,
|
|
289
298
|
options
|
|
290
299
|
};
|
|
291
|
-
if (this.emojiRepository) {
|
|
292
|
-
this.
|
|
300
|
+
if (this.isRepositoryAvailable(this.emojiRepository)) {
|
|
301
|
+
const searchResults = this.emojiRepository.search(query, options);
|
|
302
|
+
this.notifyResult(searchResults);
|
|
303
|
+
ufoExperiences['emoji-searched'].success({
|
|
304
|
+
metadata: {
|
|
305
|
+
emojisLength: searchResults.emojis.length,
|
|
306
|
+
source: (options === null || options === void 0 ? void 0 : options.source) || 'typeahead'
|
|
307
|
+
}
|
|
308
|
+
});
|
|
293
309
|
} else {
|
|
294
310
|
// not ready
|
|
295
311
|
this.notifyNotReady();
|
|
296
312
|
}
|
|
297
313
|
}
|
|
298
314
|
findByShortName(shortName) {
|
|
299
|
-
if (this.isLoaded()) {
|
|
315
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
300
316
|
// Wait for all emoji to load before looking by shortName (to ensure correct priority)
|
|
301
317
|
return this.emojiRepository.findByShortName(shortName);
|
|
302
318
|
}
|
|
@@ -307,7 +323,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
307
323
|
id,
|
|
308
324
|
shortName
|
|
309
325
|
} = emojiId;
|
|
310
|
-
if (this.emojiRepository) {
|
|
326
|
+
if (this.isRepositoryAvailable(this.emojiRepository)) {
|
|
311
327
|
if (id) {
|
|
312
328
|
const emoji = this.emojiRepository.findById(id);
|
|
313
329
|
if (emoji) {
|
|
@@ -316,7 +332,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
316
332
|
if (this.isLoaded()) {
|
|
317
333
|
// all loaded but not found by id, try server to see if
|
|
318
334
|
// this is a newly uploaded emoji
|
|
319
|
-
if (this.siteEmojiResource) {
|
|
335
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
320
336
|
return this.siteEmojiResource.findEmoji(emojiId).then(emoji => {
|
|
321
337
|
if (!emoji) {
|
|
322
338
|
// if not, fallback to searching by shortName to
|
|
@@ -340,25 +356,25 @@ export class EmojiResource extends AbstractResource {
|
|
|
340
356
|
return this.retryIfLoading(() => this.findByEmojiId(emojiId), undefined);
|
|
341
357
|
}
|
|
342
358
|
findById(id) {
|
|
343
|
-
if (this.isLoaded()) {
|
|
359
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
344
360
|
return this.emojiRepository.findById(id);
|
|
345
361
|
}
|
|
346
362
|
return this.retryIfLoading(() => this.findById(id), undefined);
|
|
347
363
|
}
|
|
348
364
|
findInCategory(categoryId) {
|
|
349
|
-
if (this.isLoaded()) {
|
|
365
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
350
366
|
return Promise.resolve(this.emojiRepository.findInCategory(categoryId));
|
|
351
367
|
}
|
|
352
368
|
return this.retryIfLoading(() => this.findInCategory(categoryId), []);
|
|
353
369
|
}
|
|
354
370
|
getAsciiMap() {
|
|
355
|
-
if (this.isLoaded()) {
|
|
371
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
356
372
|
return Promise.resolve(this.emojiRepository.getAsciiMap());
|
|
357
373
|
}
|
|
358
374
|
return this.retryIfLoading(() => this.getAsciiMap(), new Map());
|
|
359
375
|
}
|
|
360
376
|
getFrequentlyUsed(options) {
|
|
361
|
-
if (this.isLoaded()) {
|
|
377
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
362
378
|
return Promise.resolve(this.emojiRepository.getFrequentlyUsed(options));
|
|
363
379
|
}
|
|
364
380
|
return this.retryIfLoading(() => this.getFrequentlyUsed(options), []);
|
|
@@ -375,7 +391,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
375
391
|
const {
|
|
376
392
|
recordConfig
|
|
377
393
|
} = this;
|
|
378
|
-
if (this.emojiRepository) {
|
|
394
|
+
if (this.isRepositoryAvailable(this.emojiRepository)) {
|
|
379
395
|
this.emojiRepository.used(emoji);
|
|
380
396
|
}
|
|
381
397
|
if (recordConfig) {
|
|
@@ -393,9 +409,9 @@ export class EmojiResource extends AbstractResource {
|
|
|
393
409
|
return Promise.resolve();
|
|
394
410
|
}
|
|
395
411
|
deleteSiteEmoji(emoji) {
|
|
396
|
-
if (this.siteEmojiResource && emoji.id) {
|
|
412
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource) && emoji.id) {
|
|
397
413
|
return this.siteEmojiResource.deleteEmoji(emoji).then(success => {
|
|
398
|
-
if (success && this.emojiRepository) {
|
|
414
|
+
if (success && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
399
415
|
this.emojiRepository.delete(emoji);
|
|
400
416
|
return true;
|
|
401
417
|
}
|
|
@@ -426,7 +442,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
426
442
|
}
|
|
427
443
|
}
|
|
428
444
|
calculateDynamicCategories() {
|
|
429
|
-
if (this.isLoaded()) {
|
|
445
|
+
if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
|
|
430
446
|
return Promise.resolve(this.emojiRepository.getDynamicCategoryList());
|
|
431
447
|
}
|
|
432
448
|
return this.retryIfLoading(() => this.calculateDynamicCategories(), []);
|
|
@@ -435,7 +451,7 @@ export class EmojiResource extends AbstractResource {
|
|
|
435
451
|
return this.currentUser;
|
|
436
452
|
}
|
|
437
453
|
addUnknownEmoji(emoji) {
|
|
438
|
-
if (this.emojiRepository) {
|
|
454
|
+
if (this.isRepositoryAvailable(this.emojiRepository)) {
|
|
439
455
|
this.emojiRepository.addUnknownEmoji(emoji);
|
|
440
456
|
}
|
|
441
457
|
}
|
|
@@ -449,14 +465,14 @@ export default class UploadingEmojiResource extends EmojiResource {
|
|
|
449
465
|
if (!this.allowUpload) {
|
|
450
466
|
return Promise.resolve(false);
|
|
451
467
|
}
|
|
452
|
-
if (this.siteEmojiResource) {
|
|
468
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
453
469
|
return this.siteEmojiResource.hasUploadToken();
|
|
454
470
|
}
|
|
455
471
|
return this.retryIfLoading(() => this.isUploadSupported(), false);
|
|
456
472
|
}
|
|
457
473
|
uploadCustomEmoji(upload, retry = false) {
|
|
458
474
|
return this.isUploadSupported().then(supported => {
|
|
459
|
-
if (!supported || !this.siteEmojiResource) {
|
|
475
|
+
if (!supported || !this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
460
476
|
return Promise.reject('No media api support is configured');
|
|
461
477
|
}
|
|
462
478
|
return this.siteEmojiResource.uploadEmoji(upload, retry).then(emoji => {
|
|
@@ -467,7 +483,7 @@ export default class UploadingEmojiResource extends EmojiResource {
|
|
|
467
483
|
});
|
|
468
484
|
}
|
|
469
485
|
prepareForUpload() {
|
|
470
|
-
if (this.siteEmojiResource) {
|
|
486
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
471
487
|
this.siteEmojiResource.prepareForUpload();
|
|
472
488
|
}
|
|
473
489
|
return this.retryIfLoading(() => this.prepareForUpload(), undefined);
|