@atlaskit/emoji 67.0.4 → 67.0.6
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 +12 -0
- package/dist/cjs/admin.js +0 -2
- package/dist/cjs/api/EmojiLoader.js +1 -8
- package/dist/cjs/api/EmojiRepository.js +16 -80
- package/dist/cjs/api/EmojiRepositoryRegex.js +2 -0
- package/dist/cjs/api/EmojiResource.js +20 -170
- package/dist/cjs/api/EmojiUtils.js +27 -67
- package/dist/cjs/api/internal/Comparators.js +8 -62
- package/dist/cjs/api/internal/UsageFrequencyTracker.js +4 -34
- package/dist/cjs/api/media/MediaEmojiCache.js +8 -58
- package/dist/cjs/api/media/MediaImageLoader.js +4 -28
- package/dist/cjs/api/media/SiteEmojiResource.js +14 -55
- package/dist/cjs/api/media/TokenManager.js +4 -18
- package/dist/cjs/components/common/CachingEmoji.js +18 -52
- package/dist/cjs/components/common/DeleteButton.js +0 -10
- package/dist/cjs/components/common/Emoji.js +44 -102
- package/dist/cjs/components/common/EmojiActions.js +25 -61
- package/dist/cjs/components/common/EmojiButton.js +5 -18
- package/dist/cjs/components/common/EmojiDeletePreview.js +7 -38
- package/dist/cjs/components/common/EmojiErrorMessage.js +3 -9
- package/dist/cjs/components/common/EmojiPlaceholder.js +7 -16
- package/dist/cjs/components/common/EmojiPreviewComponent.js +1 -6
- package/dist/cjs/components/common/EmojiUploadPicker.js +31 -86
- package/dist/cjs/components/common/EmojiUploadPreview.js +7 -36
- package/dist/cjs/components/common/FileChooser.js +5 -18
- package/dist/cjs/components/common/LoadingEmojiComponent.js +5 -24
- package/dist/cjs/components/common/Popup.js +16 -44
- package/dist/cjs/components/common/RecordSelectionDefault.js +0 -7
- package/dist/cjs/components/common/ResourcedEmoji.js +0 -15
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +29 -69
- package/dist/cjs/components/common/RetryableButton.js +4 -19
- package/dist/cjs/components/common/Scrollable.js +6 -36
- package/dist/cjs/components/common/ToneSelector.js +3 -24
- package/dist/cjs/components/common/UfoErrorBoundary.js +1 -19
- package/dist/cjs/components/common/UploadEmoji.js +2 -13
- package/dist/cjs/components/common/internal-types.js +0 -1
- package/dist/cjs/components/common/setSkinToneAriaLabelText.js +0 -6
- package/dist/cjs/components/common/styles.js +9 -17
- package/dist/cjs/components/hooks.js +0 -2
- package/dist/cjs/components/i18n.js +0 -2
- package/dist/cjs/components/picker/CategorySelector.js +4 -50
- package/dist/cjs/components/picker/CategoryTracker.js +3 -14
- package/dist/cjs/components/picker/EmojiPicker.js +3 -42
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +2 -10
- package/dist/cjs/components/picker/EmojiPickerComponent.js +59 -140
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +7 -14
- package/dist/cjs/components/picker/EmojiPickerFooter.js +1 -8
- package/dist/cjs/components/picker/EmojiPickerList.js +32 -83
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +11 -48
- package/dist/cjs/components/picker/EmojiPickerSizes.js +1 -2
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +1 -38
- package/dist/cjs/components/picker/VirtualList.js +11 -41
- package/dist/cjs/components/picker/categories.js +0 -14
- package/dist/cjs/components/picker/styles.js +15 -20
- package/dist/cjs/components/picker/utils.js +0 -4
- package/dist/cjs/components/typeahead/EmojiTypeAhead.js +10 -45
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +11 -74
- package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +7 -37
- package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +10 -63
- package/dist/cjs/components/typeahead/styles.js +2 -4
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +6 -42
- package/dist/cjs/components/uploader/EmojiUploader.js +3 -31
- package/dist/cjs/components/uploader/styles.js +3 -4
- package/dist/cjs/context/EmojiCommonProvider.js +0 -6
- package/dist/cjs/context/EmojiContext.js +0 -2
- package/dist/cjs/context/EmojiContextProvider.js +1 -17
- package/dist/cjs/element.js +0 -4
- package/dist/cjs/hooks/useEmoji.js +5 -20
- package/dist/cjs/hooks/useEmojiContext.js +0 -4
- package/dist/cjs/hooks/usePrevious.js +0 -2
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -30
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/picker.js +0 -2
- package/dist/cjs/resource.js +0 -5
- package/dist/cjs/typeahead.js +0 -3
- package/dist/cjs/types.js +0 -17
- package/dist/cjs/util/DuplicateLimitedQueue.js +13 -31
- package/dist/cjs/util/StoredDuplicateLimitedQueue.js +4 -26
- package/dist/cjs/util/analytics/analytics.js +14 -97
- package/dist/cjs/util/analytics/index.js +0 -4
- package/dist/cjs/util/analytics/samplingUfo.js +3 -59
- package/dist/cjs/util/analytics/ufoExperiences.js +0 -12
- package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +3 -10
- package/dist/cjs/util/constants.js +5 -5
- package/dist/cjs/util/filters.js +0 -4
- package/dist/cjs/util/image.js +3 -18
- package/dist/cjs/util/logger.js +0 -6
- package/dist/cjs/util/mouse.js +3 -6
- package/dist/cjs/util/shared-styles.js +0 -4
- package/dist/cjs/util/storage-available.js +10 -8
- package/dist/cjs/util/type-helpers.js +2 -57
- package/dist/cjs/util/useInView.js +0 -6
- package/dist/cjs/utils.js +0 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiLoader.js +2 -4
- package/dist/es2019/api/EmojiRepository.js +15 -82
- package/dist/es2019/api/EmojiRepositoryRegex.js +2 -0
- package/dist/es2019/api/EmojiResource.js +21 -114
- package/dist/es2019/api/EmojiUtils.js +11 -18
- package/dist/es2019/api/internal/Comparators.js +12 -48
- package/dist/es2019/api/internal/UsageFrequencyTracker.js +7 -24
- package/dist/es2019/api/media/MediaEmojiCache.js +9 -52
- package/dist/es2019/api/media/MediaImageLoader.js +2 -16
- package/dist/es2019/api/media/SiteEmojiResource.js +11 -31
- package/dist/es2019/api/media/TokenManager.js +4 -14
- package/dist/es2019/components/common/CachingEmoji.js +5 -12
- package/dist/es2019/components/common/DeleteButton.js +2 -3
- package/dist/es2019/components/common/Emoji.js +19 -47
- package/dist/es2019/components/common/EmojiActions.js +3 -16
- package/dist/es2019/components/common/EmojiButton.js +0 -5
- package/dist/es2019/components/common/EmojiDeletePreview.js +0 -11
- package/dist/es2019/components/common/EmojiErrorMessage.js +1 -2
- package/dist/es2019/components/common/EmojiPlaceholder.js +0 -5
- package/dist/es2019/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +2 -25
- package/dist/es2019/components/common/EmojiUploadPreview.js +0 -6
- package/dist/es2019/components/common/FileChooser.js +0 -6
- package/dist/es2019/components/common/LoadingEmojiComponent.js +2 -14
- package/dist/es2019/components/common/Popup.js +4 -22
- package/dist/es2019/components/common/RecordSelectionDefault.js +1 -1
- package/dist/es2019/components/common/ResourcedEmoji.js +1 -6
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +2 -13
- package/dist/es2019/components/common/RetryableButton.js +1 -8
- package/dist/es2019/components/common/Scrollable.js +2 -12
- package/dist/es2019/components/common/ToneSelector.js +2 -8
- package/dist/es2019/components/common/UfoErrorBoundary.js +0 -2
- package/dist/es2019/components/common/UploadEmoji.js +2 -3
- package/dist/es2019/components/common/internal-types.js +0 -1
- package/dist/es2019/components/common/styles.js +12 -8
- package/dist/es2019/components/picker/CategorySelector.js +0 -22
- package/dist/es2019/components/picker/CategoryTracker.js +3 -13
- package/dist/es2019/components/picker/EmojiPicker.js +3 -17
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +2 -3
- package/dist/es2019/components/picker/EmojiPickerComponent.js +10 -43
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +0 -2
- package/dist/es2019/components/picker/EmojiPickerFooter.js +0 -2
- package/dist/es2019/components/picker/EmojiPickerList.js +10 -45
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +2 -19
- package/dist/es2019/components/picker/EmojiPickerSizes.js +1 -0
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +1 -8
- package/dist/es2019/components/picker/VirtualList.js +3 -24
- package/dist/es2019/components/picker/styles.js +22 -10
- package/dist/es2019/components/picker/utils.js +0 -1
- package/dist/es2019/components/typeahead/EmojiTypeAhead.js +4 -21
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +0 -42
- package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +0 -7
- package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +4 -45
- package/dist/es2019/components/typeahead/styles.js +2 -1
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +2 -15
- package/dist/es2019/components/uploader/EmojiUploader.js +2 -10
- package/dist/es2019/components/uploader/styles.js +5 -2
- package/dist/es2019/context/EmojiCommonProvider.js +0 -2
- package/dist/es2019/context/EmojiContextProvider.js +0 -1
- package/dist/es2019/hooks/useEmoji.js +2 -6
- package/dist/es2019/hooks/useEmojiContext.js +1 -1
- package/dist/es2019/index.js +12 -6
- package/dist/es2019/types.js +1 -11
- package/dist/es2019/util/DuplicateLimitedQueue.js +13 -35
- package/dist/es2019/util/StoredDuplicateLimitedQueue.js +5 -12
- package/dist/es2019/util/analytics/analytics.js +7 -23
- package/dist/es2019/util/analytics/samplingUfo.js +6 -32
- package/dist/es2019/util/analytics/ufoExperiences.js +0 -3
- package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +3 -7
- package/dist/es2019/util/constants.js +5 -4
- package/dist/es2019/util/filters.js +0 -3
- package/dist/es2019/util/image.js +3 -8
- package/dist/es2019/util/mouse.js +3 -3
- package/dist/es2019/util/storage-available.js +10 -7
- package/dist/es2019/util/type-helpers.js +6 -9
- package/dist/es2019/util/useInView.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiLoader.js +2 -6
- package/dist/esm/api/EmojiRepository.js +16 -71
- package/dist/esm/api/EmojiRepositoryRegex.js +2 -0
- package/dist/esm/api/EmojiResource.js +20 -158
- package/dist/esm/api/EmojiUtils.js +27 -47
- package/dist/esm/api/internal/Comparators.js +12 -53
- package/dist/esm/api/internal/UsageFrequencyTracker.js +5 -29
- package/dist/esm/api/media/MediaEmojiCache.js +9 -55
- package/dist/esm/api/media/MediaImageLoader.js +4 -27
- package/dist/esm/api/media/SiteEmojiResource.js +14 -43
- package/dist/esm/api/media/TokenManager.js +6 -16
- package/dist/esm/components/common/CachingEmoji.js +18 -30
- package/dist/esm/components/common/DeleteButton.js +2 -3
- package/dist/esm/components/common/Emoji.js +44 -78
- package/dist/esm/components/common/EmojiActions.js +25 -40
- package/dist/esm/components/common/EmojiButton.js +4 -9
- package/dist/esm/components/common/EmojiDeletePreview.js +7 -24
- package/dist/esm/components/common/EmojiErrorMessage.js +3 -4
- package/dist/esm/components/common/EmojiPlaceholder.js +6 -11
- package/dist/esm/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +30 -64
- package/dist/esm/components/common/EmojiUploadPreview.js +7 -19
- package/dist/esm/components/common/FileChooser.js +5 -11
- package/dist/esm/components/common/LoadingEmojiComponent.js +4 -20
- package/dist/esm/components/common/Popup.js +16 -36
- package/dist/esm/components/common/RecordSelectionDefault.js +1 -1
- package/dist/esm/components/common/ResourcedEmoji.js +1 -6
- package/dist/esm/components/common/ResourcedEmojiComponent.js +29 -51
- package/dist/esm/components/common/RetryableButton.js +4 -11
- package/dist/esm/components/common/Scrollable.js +6 -29
- package/dist/esm/components/common/ToneSelector.js +3 -13
- package/dist/esm/components/common/UfoErrorBoundary.js +1 -13
- package/dist/esm/components/common/UploadEmoji.js +2 -3
- package/dist/esm/components/common/internal-types.js +0 -1
- package/dist/esm/components/common/setSkinToneAriaLabelText.js +0 -2
- package/dist/esm/components/common/styles.js +12 -9
- package/dist/esm/components/picker/CategorySelector.js +4 -32
- package/dist/esm/components/picker/CategoryTracker.js +3 -13
- package/dist/esm/components/picker/EmojiPicker.js +5 -27
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +4 -5
- package/dist/esm/components/picker/EmojiPickerComponent.js +60 -114
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +6 -8
- package/dist/esm/components/picker/EmojiPickerFooter.js +0 -2
- package/dist/esm/components/picker/EmojiPickerList.js +32 -77
- package/dist/esm/components/picker/EmojiPickerListSearch.js +11 -35
- package/dist/esm/components/picker/EmojiPickerSizes.js +1 -0
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +2 -26
- package/dist/esm/components/picker/VirtualList.js +11 -28
- package/dist/esm/components/picker/styles.js +22 -11
- package/dist/esm/components/picker/utils.js +0 -1
- package/dist/esm/components/typeahead/EmojiTypeAhead.js +11 -39
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +11 -65
- package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +7 -24
- package/dist/esm/components/typeahead/EmojiTypeAheadList.js +10 -53
- package/dist/esm/components/typeahead/styles.js +2 -1
- package/dist/esm/components/uploader/EmojiUploadComponent.js +5 -25
- package/dist/esm/components/uploader/EmojiUploader.js +4 -22
- package/dist/esm/components/uploader/styles.js +5 -2
- package/dist/esm/context/EmojiCommonProvider.js +0 -2
- package/dist/esm/context/EmojiContextProvider.js +1 -6
- package/dist/esm/hooks/useEmoji.js +5 -13
- package/dist/esm/hooks/useEmojiContext.js +1 -1
- package/dist/esm/index.js +12 -6
- package/dist/esm/types.js +1 -11
- package/dist/esm/util/DuplicateLimitedQueue.js +13 -29
- package/dist/esm/util/StoredDuplicateLimitedQueue.js +5 -22
- package/dist/esm/util/analytics/analytics.js +14 -50
- package/dist/esm/util/analytics/samplingUfo.js +3 -51
- package/dist/esm/util/analytics/ufoExperiences.js +0 -3
- package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +3 -7
- package/dist/esm/util/constants.js +5 -4
- package/dist/esm/util/filters.js +0 -3
- package/dist/esm/util/image.js +3 -8
- package/dist/esm/util/logger.js +0 -2
- package/dist/esm/util/mouse.js +3 -3
- package/dist/esm/util/storage-available.js +10 -7
- package/dist/esm/util/type-helpers.js +2 -12
- package/dist/esm/util/useInView.js +0 -2
- package/dist/esm/version.json +1 -1
- package/package.json +6 -4
|
@@ -1,94 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.toOptionalEmojiId = exports.toEmojiId = exports.isSpriteServiceRepresentation = exports.isSpriteRepresentation = exports.isPromise = exports.isMessagesKey = exports.isMediaRepresentation = exports.isMediaEmoji = exports.isLoadedMediaEmoji = exports.isImageRepresentation = exports.isEmojiVariationDescription = exports.isEmojiIdEqual = exports.isEmojiDescriptionWithVariations = exports.isEmojiDescription = exports.hasDataURLImage = exports.getCategoryId = exports.convertMediaToImageRepresentation = exports.convertMediaToImageEmoji = exports.convertImageToMediaRepresentation = exports.containsEmojiId = exports.buildEmojiDescriptionWithAltRepresentation = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _i18n = require("../components/i18n");
|
|
13
|
-
|
|
14
10
|
var _constants = require("./constants");
|
|
15
|
-
|
|
16
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
13
|
var isSpriteServiceRepresentation = function isSpriteServiceRepresentation(rep) {
|
|
21
14
|
return !!(rep && rep.spriteRef);
|
|
22
15
|
};
|
|
23
|
-
|
|
24
16
|
exports.isSpriteServiceRepresentation = isSpriteServiceRepresentation;
|
|
25
|
-
|
|
26
17
|
var isSpriteRepresentation = function isSpriteRepresentation(rep) {
|
|
27
18
|
return !!(rep && rep.sprite);
|
|
28
19
|
};
|
|
29
|
-
|
|
30
20
|
exports.isSpriteRepresentation = isSpriteRepresentation;
|
|
31
|
-
|
|
32
21
|
var isImageRepresentation = function isImageRepresentation(rep) {
|
|
33
22
|
return !!(rep && rep.imagePath);
|
|
34
23
|
};
|
|
35
|
-
|
|
36
24
|
exports.isImageRepresentation = isImageRepresentation;
|
|
37
|
-
|
|
38
25
|
var isMediaRepresentation = function isMediaRepresentation(rep) {
|
|
39
26
|
return !!(rep && rep.mediaPath);
|
|
40
27
|
};
|
|
41
|
-
|
|
42
28
|
exports.isMediaRepresentation = isMediaRepresentation;
|
|
43
|
-
|
|
44
29
|
var isPromise = function isPromise(p) {
|
|
45
30
|
return !!(p && p.then);
|
|
46
31
|
};
|
|
47
|
-
|
|
48
32
|
exports.isPromise = isPromise;
|
|
49
|
-
|
|
50
33
|
var isEmojiDescription = function isEmojiDescription(possibleEmojiDescription) {
|
|
51
34
|
return possibleEmojiDescription && possibleEmojiDescription.shortName && possibleEmojiDescription.type;
|
|
52
35
|
};
|
|
53
|
-
|
|
54
36
|
exports.isEmojiDescription = isEmojiDescription;
|
|
55
|
-
|
|
56
37
|
var isMediaEmoji = function isMediaEmoji(emoji) {
|
|
57
38
|
return isMediaRepresentation(emoji.representation);
|
|
58
39
|
};
|
|
59
|
-
|
|
60
40
|
exports.isMediaEmoji = isMediaEmoji;
|
|
61
|
-
|
|
62
41
|
var hasDataURLImage = function hasDataURLImage(rep) {
|
|
63
42
|
return isImageRepresentation(rep) && rep.imagePath.indexOf(_constants.dataURLPrefix) === 0;
|
|
64
43
|
};
|
|
65
|
-
|
|
66
44
|
exports.hasDataURLImage = hasDataURLImage;
|
|
67
|
-
|
|
68
45
|
var isLoadedMediaEmoji = function isLoadedMediaEmoji(emoji) {
|
|
69
46
|
return emoji.category === _constants.customCategory && hasDataURLImage(emoji.representation);
|
|
70
47
|
};
|
|
71
|
-
|
|
72
48
|
exports.isLoadedMediaEmoji = isLoadedMediaEmoji;
|
|
73
|
-
|
|
74
49
|
var isEmojiDescriptionWithVariations = function isEmojiDescriptionWithVariations(emoji) {
|
|
75
50
|
return !!(emoji && emoji.skinVariations);
|
|
76
51
|
};
|
|
77
|
-
|
|
78
52
|
exports.isEmojiDescriptionWithVariations = isEmojiDescriptionWithVariations;
|
|
79
|
-
|
|
80
53
|
var isEmojiVariationDescription = function isEmojiVariationDescription(object) {
|
|
81
54
|
return 'baseId' in object;
|
|
82
55
|
};
|
|
83
|
-
|
|
84
56
|
exports.isEmojiVariationDescription = isEmojiVariationDescription;
|
|
85
|
-
|
|
86
57
|
var isMessagesKey = function isMessagesKey(key) {
|
|
87
58
|
return key in _i18n.messages;
|
|
88
59
|
};
|
|
89
|
-
|
|
90
60
|
exports.isMessagesKey = isMessagesKey;
|
|
91
|
-
|
|
92
61
|
var toEmojiId = function toEmojiId(emoji) {
|
|
93
62
|
return {
|
|
94
63
|
shortName: emoji.shortName,
|
|
@@ -96,41 +65,30 @@ var toEmojiId = function toEmojiId(emoji) {
|
|
|
96
65
|
fallback: emoji.fallback
|
|
97
66
|
};
|
|
98
67
|
};
|
|
99
|
-
|
|
100
68
|
exports.toEmojiId = toEmojiId;
|
|
101
|
-
|
|
102
69
|
var toOptionalEmojiId = function toOptionalEmojiId(emoji) {
|
|
103
70
|
if (!emoji) {
|
|
104
71
|
return undefined;
|
|
105
72
|
}
|
|
106
|
-
|
|
107
73
|
return toEmojiId(emoji);
|
|
108
74
|
};
|
|
109
|
-
|
|
110
75
|
exports.toOptionalEmojiId = toOptionalEmojiId;
|
|
111
|
-
|
|
112
76
|
var isEmojiIdEqual = function isEmojiIdEqual(l, r) {
|
|
113
77
|
return l === r || l && r && l.id === r.id && l.shortName === r.shortName;
|
|
114
78
|
};
|
|
115
|
-
|
|
116
79
|
exports.isEmojiIdEqual = isEmojiIdEqual;
|
|
117
|
-
|
|
118
80
|
var containsEmojiId = function containsEmojiId(emojis, emojiId) {
|
|
119
81
|
if (!emojiId) {
|
|
120
82
|
return false;
|
|
121
83
|
}
|
|
122
|
-
|
|
123
84
|
for (var i = 0; i < emojis.length; i++) {
|
|
124
85
|
if (isEmojiIdEqual(emojis[i], emojiId)) {
|
|
125
86
|
return true;
|
|
126
87
|
}
|
|
127
88
|
}
|
|
128
|
-
|
|
129
89
|
return false;
|
|
130
90
|
};
|
|
131
|
-
|
|
132
91
|
exports.containsEmojiId = containsEmojiId;
|
|
133
|
-
|
|
134
92
|
var convertImageToMediaRepresentation = function convertImageToMediaRepresentation(rep) {
|
|
135
93
|
return {
|
|
136
94
|
mediaPath: rep.imagePath,
|
|
@@ -138,9 +96,7 @@ var convertImageToMediaRepresentation = function convertImageToMediaRepresentati
|
|
|
138
96
|
width: rep.width
|
|
139
97
|
};
|
|
140
98
|
};
|
|
141
|
-
|
|
142
99
|
exports.convertImageToMediaRepresentation = convertImageToMediaRepresentation;
|
|
143
|
-
|
|
144
100
|
var convertMediaToImageRepresentation = function convertMediaToImageRepresentation(rep, newImagePath) {
|
|
145
101
|
return {
|
|
146
102
|
imagePath: newImagePath || rep.mediaPath,
|
|
@@ -148,46 +104,35 @@ var convertMediaToImageRepresentation = function convertMediaToImageRepresentati
|
|
|
148
104
|
width: rep.width
|
|
149
105
|
};
|
|
150
106
|
};
|
|
151
|
-
|
|
152
107
|
exports.convertMediaToImageRepresentation = convertMediaToImageRepresentation;
|
|
153
|
-
|
|
154
108
|
var convertMediaToImageEmoji = function convertMediaToImageEmoji(emoji, newImagePath, useAlt) {
|
|
155
109
|
var mediaRepresentation = emoji.representation;
|
|
156
110
|
var mediaAltRepresentation = emoji.altRepresentation;
|
|
157
111
|
var imgPath = !useAlt ? newImagePath : undefined;
|
|
158
112
|
var altImgPath = useAlt ? newImagePath : undefined;
|
|
159
|
-
|
|
160
113
|
if (!isMediaRepresentation(mediaRepresentation) && !isMediaRepresentation(mediaAltRepresentation)) {
|
|
161
114
|
return emoji;
|
|
162
115
|
}
|
|
163
|
-
|
|
164
116
|
var representation = isMediaRepresentation(mediaRepresentation) ? convertMediaToImageRepresentation(mediaRepresentation, imgPath) : mediaRepresentation;
|
|
165
117
|
var altRepresentation = isMediaRepresentation(mediaAltRepresentation) ? convertMediaToImageRepresentation(mediaAltRepresentation, altImgPath) : mediaAltRepresentation;
|
|
166
|
-
|
|
167
118
|
var baseEmoji = _objectSpread(_objectSpread({}, emoji), {}, {
|
|
168
119
|
representation: representation
|
|
169
120
|
});
|
|
170
|
-
|
|
171
121
|
return buildEmojiDescriptionWithAltRepresentation(baseEmoji, altRepresentation);
|
|
172
|
-
};
|
|
173
|
-
|
|
122
|
+
};
|
|
174
123
|
|
|
124
|
+
// Prevent altRepresentation: undefined from being returned in EmojiDescription
|
|
175
125
|
exports.convertMediaToImageEmoji = convertMediaToImageEmoji;
|
|
176
|
-
|
|
177
126
|
var buildEmojiDescriptionWithAltRepresentation = function buildEmojiDescriptionWithAltRepresentation(emoji, altRepresentation) {
|
|
178
127
|
if (!altRepresentation) {
|
|
179
128
|
return emoji;
|
|
180
129
|
}
|
|
181
|
-
|
|
182
130
|
return _objectSpread(_objectSpread({}, emoji), {}, {
|
|
183
131
|
altRepresentation: altRepresentation
|
|
184
132
|
});
|
|
185
133
|
};
|
|
186
|
-
|
|
187
134
|
exports.buildEmojiDescriptionWithAltRepresentation = buildEmojiDescriptionWithAltRepresentation;
|
|
188
|
-
|
|
189
135
|
var getCategoryId = function getCategoryId(emoji) {
|
|
190
136
|
return emoji.category;
|
|
191
137
|
};
|
|
192
|
-
|
|
193
138
|
exports.getCategoryId = getCategoryId;
|
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInView = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactIntersectionObserver = require("react-intersection-observer");
|
|
9
|
-
|
|
10
8
|
var _browserSupport = require("./browser-support");
|
|
11
|
-
|
|
12
9
|
var useInView = function useInView(options) {
|
|
13
10
|
var hookResult = (0, _reactIntersectionObserver.useInView)(options);
|
|
14
|
-
|
|
15
11
|
if (!_browserSupport.isIntersectionObserverSupported) {
|
|
16
12
|
// Unsupported, return no `ref` and default `inView` true value
|
|
17
13
|
return [undefined, true];
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
return hookResult;
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
exports.useInView = useInView;
|
package/dist/cjs/utils.js
CHANGED
|
@@ -27,9 +27,6 @@ Object.defineProperty(exports, "toOptionalEmojiId", {
|
|
|
27
27
|
return _typeHelpers.toOptionalEmojiId;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
var _typeHelpers = require("./util/type-helpers");
|
|
32
|
-
|
|
33
31
|
var _EmojiUtils = require("./api/EmojiUtils");
|
|
34
|
-
|
|
35
32
|
var _UsageFrequencyTracker = require("./api/internal/UsageFrequencyTracker");
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { denormaliseEmojiServiceResponse, emojiRequest } from './EmojiUtils';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Emoji providers should return JSON in the format defined by EmojiServiceResponse.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
6
|
export default class EmojiLoader {
|
|
7
7
|
constructor(config) {
|
|
8
8
|
this.config = config;
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Returns a promise with an array of Emoji from all providers.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
14
|
loadEmoji() {
|
|
16
15
|
const emojisPromise = emojiRequest(this.config);
|
|
17
16
|
return emojisPromise.then(emojiServiceResponse => denormaliseEmojiServiceResponse(emojiServiceResponse));
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
}
|
|
@@ -6,18 +6,15 @@ import { SearchSort } from '../types';
|
|
|
6
6
|
import { tokenizerRegex } from './EmojiRepositoryRegex';
|
|
7
7
|
import { createSearchEmojiComparator, createUsageOnlyEmojiComparator } from './internal/Comparators';
|
|
8
8
|
import { UsageFrequencyTracker } from './internal/UsageFrequencyTracker';
|
|
9
|
-
|
|
10
9
|
// FS-1097 - duplicated in mentions - extract at some point into a shared library
|
|
11
10
|
class Tokenizer {
|
|
12
11
|
tokenize(text) {
|
|
13
12
|
return this.tokenizeAsTokens(text).map(token => token.token);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
tokenizeAsTokens(text) {
|
|
17
15
|
let match;
|
|
18
16
|
let tokens = [];
|
|
19
17
|
tokenizerRegex.lastIndex = 0;
|
|
20
|
-
|
|
21
18
|
while ((match = tokenizerRegex.exec(text)) !== null) {
|
|
22
19
|
if (match[0]) {
|
|
23
20
|
tokens.push({
|
|
@@ -26,78 +23,60 @@ class Tokenizer {
|
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
return tokens;
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
const addAllVariants = (emoji, fnKey, map) => {
|
|
36
30
|
const key = fnKey(emoji);
|
|
37
|
-
|
|
38
31
|
if (!map.has(key)) {
|
|
39
32
|
map.set(key, []);
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
const emojisForKey = map.get(key);
|
|
35
|
+
// Unnecessary, but typescript thinks it is. :/
|
|
44
36
|
if (emojisForKey) {
|
|
45
37
|
emojisForKey.push(emoji);
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
if (isEmojiDescriptionWithVariations(emoji)) {
|
|
49
40
|
// map variations too
|
|
50
41
|
const variations = emoji.skinVariations;
|
|
51
|
-
|
|
52
42
|
if (variations) {
|
|
53
43
|
variations.forEach(variation => addAllVariants(variation, fnKey, map));
|
|
54
44
|
}
|
|
55
45
|
}
|
|
56
46
|
};
|
|
57
|
-
|
|
58
47
|
const findByKey = (map, key) => {
|
|
59
48
|
const emojis = map.get(key);
|
|
60
|
-
|
|
61
49
|
if (emojis && emojis.length) {
|
|
62
50
|
// Priority is always to source from the last emoji set (last overrides first)
|
|
63
51
|
return emojis[emojis.length - 1];
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
return undefined;
|
|
67
54
|
};
|
|
68
|
-
|
|
69
55
|
const splitQuery = (query = '') => {
|
|
70
56
|
const isColonQuery = query.indexOf(':') === 0;
|
|
71
|
-
|
|
72
57
|
if (isColonQuery) {
|
|
73
58
|
return {
|
|
74
59
|
nameQuery: query.slice(1),
|
|
75
60
|
asciiQuery: query
|
|
76
61
|
};
|
|
77
62
|
}
|
|
78
|
-
|
|
79
63
|
return {
|
|
80
64
|
nameQuery: query,
|
|
81
65
|
asciiQuery: ''
|
|
82
66
|
};
|
|
83
67
|
};
|
|
84
|
-
|
|
85
68
|
export const getEmojiVariation = (emoji, options) => {
|
|
86
69
|
if (isEmojiDescriptionWithVariations(emoji) && options) {
|
|
87
70
|
const skinTone = options.skinTone;
|
|
88
|
-
|
|
89
71
|
if (skinTone && emoji.skinVariations && emoji.skinVariations.length) {
|
|
90
72
|
const skinToneEmoji = emoji.skinVariations[skinTone - 1]; // skinTone start at 1
|
|
91
|
-
|
|
92
73
|
if (skinToneEmoji) {
|
|
93
74
|
return skinToneEmoji;
|
|
94
75
|
}
|
|
95
76
|
}
|
|
96
77
|
}
|
|
97
|
-
|
|
98
78
|
return emoji;
|
|
99
79
|
};
|
|
100
|
-
|
|
101
80
|
const findEmojiIndex = (emojis, toFind) => {
|
|
102
81
|
const findId = toFind.id;
|
|
103
82
|
let match = -1;
|
|
@@ -111,23 +90,22 @@ const findEmojiIndex = (emojis, toFind) => {
|
|
|
111
90
|
});
|
|
112
91
|
return match;
|
|
113
92
|
};
|
|
114
|
-
|
|
115
93
|
export default class EmojiRepository {
|
|
116
94
|
constructor(emojis, usageTracker) {
|
|
117
95
|
this.emojis = emojis;
|
|
118
96
|
this.initMembers(usageTracker);
|
|
119
97
|
}
|
|
98
|
+
|
|
120
99
|
/**
|
|
121
100
|
* Returns all available (and searchable) emoji in some default order.
|
|
122
101
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
102
|
all() {
|
|
126
103
|
const options = {
|
|
127
104
|
sort: SearchSort.None
|
|
128
105
|
};
|
|
129
106
|
return this.search('', options);
|
|
130
107
|
}
|
|
108
|
+
|
|
131
109
|
/**
|
|
132
110
|
* Text search of emoji shortName and name field for suitable matches.
|
|
133
111
|
*
|
|
@@ -137,60 +115,50 @@ export default class EmojiRepository {
|
|
|
137
115
|
* you don't want any sorting you can also disable via the SearchOptions (this might be a useful optimisation).
|
|
138
116
|
* If no sort is specified in SearchOptions then a default sorting it applied based on the query.
|
|
139
117
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
118
|
search(query, options) {
|
|
143
119
|
let filteredEmoji = [];
|
|
144
120
|
const {
|
|
145
121
|
nameQuery,
|
|
146
122
|
asciiQuery
|
|
147
123
|
} = splitQuery(query);
|
|
148
|
-
|
|
149
124
|
if (nameQuery) {
|
|
150
125
|
filteredEmoji = this.fullSearch.search(nameQuery);
|
|
151
|
-
|
|
152
126
|
if (asciiQuery) {
|
|
153
127
|
filteredEmoji = this.withAsciiMatch(asciiQuery, filteredEmoji);
|
|
154
128
|
}
|
|
155
129
|
} else {
|
|
156
130
|
filteredEmoji = this.getAllSearchableEmojis();
|
|
157
131
|
}
|
|
158
|
-
|
|
159
132
|
filteredEmoji = this.applySearchOptions(filteredEmoji, query, options);
|
|
160
133
|
return {
|
|
161
134
|
emojis: filteredEmoji,
|
|
162
135
|
query
|
|
163
136
|
};
|
|
164
137
|
}
|
|
138
|
+
|
|
165
139
|
/**
|
|
166
140
|
* Returns all emoji with matching shortName
|
|
167
141
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
142
|
findAllMatchingShortName(shortName) {
|
|
171
143
|
return this.shortNameMap.get(shortName) || [];
|
|
172
144
|
}
|
|
145
|
+
|
|
173
146
|
/**
|
|
174
147
|
* Returns the first matching emoji matching the shortName, or null if none found.
|
|
175
148
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
149
|
findByShortName(shortName) {
|
|
179
150
|
return findByKey(this.shortNameMap, shortName);
|
|
180
151
|
}
|
|
152
|
+
|
|
181
153
|
/**
|
|
182
154
|
* Returns the first matching emoji matching the id, or null if none found.
|
|
183
155
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
156
|
findById(id) {
|
|
187
157
|
return findByKey(this.idMap, id);
|
|
188
158
|
}
|
|
189
|
-
|
|
190
159
|
findByAsciiRepresentation(asciiEmoji) {
|
|
191
160
|
return this.asciiMap.get(asciiEmoji);
|
|
192
161
|
}
|
|
193
|
-
|
|
194
162
|
findInCategory(categoryId) {
|
|
195
163
|
if (categoryId === frequentCategory) {
|
|
196
164
|
return this.getFrequentlyUsed();
|
|
@@ -198,135 +166,112 @@ export default class EmojiRepository {
|
|
|
198
166
|
return this.all().emojis.filter(emoji => emoji.category === categoryId);
|
|
199
167
|
}
|
|
200
168
|
}
|
|
201
|
-
|
|
202
169
|
addUnknownEmoji(emoji) {
|
|
203
170
|
this.emojis = [...this.emojis, emoji];
|
|
204
171
|
this.fullSearch.addDocuments([emoji]);
|
|
205
172
|
this.addToMaps(emoji);
|
|
206
173
|
this.addToDynamicCategories(emoji);
|
|
207
174
|
}
|
|
208
|
-
|
|
209
175
|
getAsciiMap() {
|
|
210
176
|
return this.asciiMap;
|
|
211
177
|
}
|
|
178
|
+
|
|
212
179
|
/**
|
|
213
180
|
* Return the most frequently used emoji, ordered from most frequent to least frequent. Return an empty array if
|
|
214
181
|
* there are none.
|
|
215
182
|
*
|
|
216
183
|
* @param options optional settings to be applied to the set of frequently used emoji
|
|
217
184
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
185
|
getFrequentlyUsed(options) {
|
|
221
186
|
const emojiIds = this.usageTracker.getOrder();
|
|
222
187
|
let emojiResult = emojiIds.map(id => this.findById(id)).filter(e => e !== undefined);
|
|
223
|
-
|
|
224
188
|
if (options) {
|
|
225
189
|
emojiResult = this.applySearchOptions(emojiResult, '', options);
|
|
226
190
|
}
|
|
227
|
-
|
|
228
191
|
return emojiResult;
|
|
229
192
|
}
|
|
230
|
-
|
|
231
193
|
getDynamicCategoryList() {
|
|
232
194
|
return this.dynamicCategoryList.slice();
|
|
233
195
|
}
|
|
196
|
+
|
|
234
197
|
/**
|
|
235
198
|
* Call this on emoji usage to allow the EmojiRepository to track the usage of emoji (which could be useful
|
|
236
199
|
* in sorting, etc).
|
|
237
200
|
*
|
|
238
201
|
* @param emoji the emoji that was just used
|
|
239
202
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
203
|
used(emoji) {
|
|
243
|
-
this.usageTracker.recordUsage(emoji);
|
|
204
|
+
this.usageTracker.recordUsage(emoji);
|
|
205
|
+
|
|
206
|
+
// If this is the first usage ensure that we update the dynamic categories.
|
|
244
207
|
// This is done in a 'timeout' since the usageTracker call previously also happens in a timeout. This ensures that
|
|
245
208
|
// the frequent category will not appear until the usage has been tracked (avoiding the possibility of an empty
|
|
246
209
|
// frequent category being shown in the picker).
|
|
247
|
-
|
|
248
210
|
if (this.dynamicCategoryList.indexOf(frequentCategory) === -1) {
|
|
249
211
|
if (typeof window === 'undefined') {
|
|
250
212
|
return;
|
|
251
213
|
}
|
|
252
|
-
|
|
253
214
|
window.setTimeout(() => {
|
|
254
215
|
this.dynamicCategoryList.push(frequentCategory);
|
|
255
216
|
});
|
|
256
217
|
}
|
|
257
218
|
}
|
|
258
|
-
|
|
259
219
|
delete(emoji) {
|
|
260
220
|
const deletedIndex = findEmojiIndex(this.emojis, emoji);
|
|
261
|
-
|
|
262
221
|
if (deletedIndex !== -1) {
|
|
263
222
|
// Remove the deleted emojis from the internal list
|
|
264
|
-
this.emojis.splice(deletedIndex, 1);
|
|
265
|
-
|
|
223
|
+
this.emojis.splice(deletedIndex, 1);
|
|
224
|
+
// Reconstruct repository member variables
|
|
266
225
|
this.initMembers(this.usageTracker);
|
|
267
226
|
}
|
|
268
227
|
}
|
|
269
|
-
|
|
270
228
|
withAsciiMatch(ascii, emojis) {
|
|
271
229
|
let result = emojis;
|
|
272
230
|
const asciiEmoji = this.findByAsciiRepresentation(ascii);
|
|
273
|
-
|
|
274
231
|
if (asciiEmoji) {
|
|
275
232
|
// Ensures that the same emoji isn't already in the list
|
|
276
233
|
// If it is, we give precedence to the ascii match
|
|
277
234
|
result = emojis.filter(e => e.id !== asciiEmoji.id);
|
|
278
235
|
result = [asciiEmoji, ...result];
|
|
279
236
|
}
|
|
280
|
-
|
|
281
237
|
return result;
|
|
282
238
|
}
|
|
283
|
-
|
|
284
239
|
applySearchOptions(emojis, query, options) {
|
|
285
240
|
if (!options) {
|
|
286
241
|
options = {};
|
|
287
242
|
}
|
|
288
|
-
|
|
289
243
|
if (options.sort === undefined) {
|
|
290
244
|
options.sort = SearchSort.Default;
|
|
291
245
|
}
|
|
292
|
-
|
|
293
246
|
let comparator;
|
|
294
|
-
|
|
295
247
|
if (options.sort === SearchSort.Default) {
|
|
296
248
|
comparator = createSearchEmojiComparator(query, this.usageTracker.getOrder());
|
|
297
249
|
} else if (options.sort === SearchSort.UsageFrequency) {
|
|
298
250
|
comparator = createUsageOnlyEmojiComparator(this.usageTracker.getOrder());
|
|
299
251
|
}
|
|
300
|
-
|
|
301
252
|
if (comparator) {
|
|
302
253
|
comparator.compare = comparator.compare.bind(comparator); // TODO bind at a better place
|
|
303
|
-
|
|
304
254
|
emojis = emojis.sort(comparator.compare);
|
|
305
255
|
}
|
|
306
|
-
|
|
307
256
|
if (options.limit && options.limit > 0) {
|
|
308
257
|
emojis = emojis.slice(0, options.limit);
|
|
309
258
|
}
|
|
310
|
-
|
|
311
259
|
if (options.skinTone) {
|
|
312
260
|
return emojis.map(emoji => {
|
|
313
261
|
return getEmojiVariation(emoji, options);
|
|
314
262
|
});
|
|
315
263
|
}
|
|
316
|
-
|
|
317
264
|
return emojis;
|
|
318
265
|
}
|
|
319
|
-
|
|
320
266
|
initMembers(usageTracker) {
|
|
321
267
|
this.usageTracker = usageTracker || new UsageFrequencyTracker();
|
|
322
268
|
this.initRepositoryMetadata();
|
|
323
269
|
this.initSearchIndex();
|
|
324
270
|
}
|
|
271
|
+
|
|
325
272
|
/**
|
|
326
273
|
* Optimisation to initialise all map member variables in single loop over emojis
|
|
327
274
|
*/
|
|
328
|
-
|
|
329
|
-
|
|
330
275
|
initRepositoryMetadata() {
|
|
331
276
|
this.shortNameMap = new Map();
|
|
332
277
|
this.idMap = new Map();
|
|
@@ -336,14 +281,11 @@ export default class EmojiRepository {
|
|
|
336
281
|
categorySet.add(emoji.category);
|
|
337
282
|
this.addToMaps(emoji);
|
|
338
283
|
});
|
|
339
|
-
|
|
340
284
|
if (this.usageTracker.getOrder().length) {
|
|
341
285
|
categorySet.add(frequentCategory);
|
|
342
286
|
}
|
|
343
|
-
|
|
344
287
|
this.dynamicCategoryList = Array.from(categorySet).filter(category => defaultCategories.indexOf(category) === -1);
|
|
345
288
|
}
|
|
346
|
-
|
|
347
289
|
initSearchIndex() {
|
|
348
290
|
this.fullSearch = new Search('id');
|
|
349
291
|
this.fullSearch.tokenizer = new Tokenizer();
|
|
@@ -352,37 +294,28 @@ export default class EmojiRepository {
|
|
|
352
294
|
this.fullSearch.addIndex('shortName');
|
|
353
295
|
this.fullSearch.addDocuments(this.getAllSearchableEmojis());
|
|
354
296
|
}
|
|
355
|
-
|
|
356
297
|
getAllSearchableEmojis() {
|
|
357
298
|
return this.emojis.filter(emojiDescription => emojiDescription.searchable);
|
|
358
299
|
}
|
|
359
|
-
|
|
360
300
|
addToMaps(emoji) {
|
|
361
301
|
// Give default value and assign higher weight to Atlassian emojis for logical order when sorting
|
|
362
302
|
if (typeof emoji.order === 'undefined' || emoji.order === -1) {
|
|
363
303
|
emoji.order = EmojiRepository.defaultEmojiWeight;
|
|
364
304
|
}
|
|
365
|
-
|
|
366
305
|
if (typeof emoji.id === 'undefined') {
|
|
367
306
|
emoji.id = EmojiRepository.defaultEmojiWeight.toString();
|
|
368
307
|
}
|
|
369
|
-
|
|
370
308
|
addAllVariants(emoji, e => e.shortName, this.shortNameMap);
|
|
371
309
|
addAllVariants(emoji, e => e.id, this.idMap);
|
|
372
|
-
|
|
373
310
|
if (emoji.ascii) {
|
|
374
311
|
emoji.ascii.forEach(a => this.asciiMap.set(a, emoji));
|
|
375
312
|
}
|
|
376
313
|
}
|
|
377
|
-
|
|
378
314
|
addToDynamicCategories(emoji) {
|
|
379
315
|
const category = getCategoryId(emoji);
|
|
380
|
-
|
|
381
316
|
if (defaultCategories.indexOf(category) === -1 && this.dynamicCategoryList.indexOf(category) === -1) {
|
|
382
317
|
this.dynamicCategoryList.push(category);
|
|
383
318
|
}
|
|
384
319
|
}
|
|
385
|
-
|
|
386
320
|
}
|
|
387
|
-
|
|
388
321
|
_defineProperty(EmojiRepository, "defaultEmojiWeight", 1000000);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// \p{Han} => each chinese character is a separate token
|
|
2
2
|
// \p{L}+[\p{Mn}|']*\p{L} => consecutive letters, including non spacing mark and apostrophe are a single token
|
|
3
3
|
// const tokenizerRegex = new XRegExp("\\p{Han}|[\\p{L}|\\p{N}]+[\\p{Mn}|']*\\p{L}*", 'gi');
|
|
4
|
+
|
|
4
5
|
// Note: Regex compiled to unicode charsets using xregexp-transformer, refer to it if you need to compile it again.
|
|
5
6
|
// @atlaskit/xregexp-transformer (https://bitbucket.org/atlassian/xregexp-transformer)
|
|
7
|
+
|
|
6
8
|
// eslint-disable-next-line no-misleading-character-class
|
|
7
9
|
export const tokenizerRegex = new RegExp("[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FEF\uF900-\uFA6D\uFA70-\uFAD9]|[A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC|0-9\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]+[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F|']*[A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*", 'gi');
|