@atlaskit/emoji 71.17.0 → 72.0.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 +52 -0
- package/dist/cjs/api/EmojiLoader.js +4 -3
- package/dist/cjs/api/EmojiRepository.js +25 -24
- package/dist/cjs/api/EmojiResource.js +31 -30
- package/dist/cjs/api/EmojiUtils.js +72 -167
- package/dist/cjs/api/calculateScale.js +34 -0
- package/dist/cjs/api/denormaliseEmojiServiceResponse.js +43 -0
- package/dist/cjs/api/denormaliseServiceAltRepresentation.js +11 -0
- package/dist/cjs/api/denormaliseServiceRepresentation.js +50 -0
- package/dist/cjs/api/denormaliseSkinEmoji.js +31 -0
- package/dist/cjs/api/denormaliseStandardRepresentation.js +17 -0
- package/dist/cjs/api/emojiRequest.js +32 -0
- package/dist/cjs/api/getAltRepresentation.js +12 -0
- package/dist/cjs/api/getEmojiVariation.js +19 -0
- package/dist/cjs/api/getPixelRatio.js +12 -0
- package/dist/cjs/api/internal/AlphabeticalShortnameComparator.js +25 -0
- package/dist/cjs/api/internal/AsciiMatchComparator.js +32 -0
- package/dist/cjs/api/internal/ChainedEmojiComparator.js +37 -0
- package/dist/cjs/api/internal/Comparators.js +1 -275
- package/dist/cjs/api/internal/EmojiTypeComparator.js +40 -0
- package/dist/cjs/api/internal/ExactShortNameMatchComparator.js +34 -0
- package/dist/cjs/api/internal/Gateway.js +52 -0
- package/dist/cjs/api/internal/OrderComparator.js +28 -0
- package/dist/cjs/api/internal/QueryStringPositionMatchComparator.js +43 -0
- package/dist/cjs/api/internal/UsageFrequencyComparator.js +59 -0
- package/dist/cjs/api/internal/UsageFrequencyTracker.js +7 -49
- package/dist/cjs/api/internal/createSearchEmojiComparator.js +46 -0
- package/dist/cjs/api/internal/createUsageOnlyEmojiComparator.js +15 -0
- package/dist/cjs/api/isMediaApiUrl.js +9 -0
- package/dist/cjs/api/media/BrowserCacheStrategy.js +87 -0
- package/dist/cjs/api/media/MediaEmojiCache.js +24 -148
- package/dist/cjs/api/media/MemoryCacheStrategy.js +67 -0
- package/dist/cjs/api/media/SiteEmojiResource.js +21 -15
- package/dist/cjs/api/media/getRequiredRepresentation.js +9 -0
- package/dist/cjs/api/shouldUseAltRepresentation.js +13 -0
- package/dist/cjs/api/supportsUploadFeature.js +17 -0
- package/dist/cjs/components/common/AddOwnEmoji.compiled.css +6 -0
- package/dist/cjs/components/common/AddOwnEmoji.js +62 -0
- package/dist/cjs/components/common/CachingEmoji.js +15 -93
- package/dist/cjs/components/common/CachingMediaEmoji.js +95 -0
- package/dist/cjs/components/common/CreateEmojiWithRovo.js +6 -4
- package/dist/cjs/components/common/DeletableEmojiTooltipContent.js +2 -14
- package/dist/cjs/components/common/DeletableEmojiTooltipContentForScreenReader.js +22 -0
- package/dist/cjs/components/common/Emoji.js +32 -374
- package/dist/cjs/components/common/EmojiActions.compiled.css +0 -6
- package/dist/cjs/components/common/EmojiActions.js +15 -69
- package/dist/cjs/components/common/EmojiPlaceholder.js +14 -6
- package/dist/cjs/components/common/ImageEmoji.js +198 -0
- package/dist/cjs/components/common/RecordSelectionDefault.js +10 -8
- package/dist/cjs/components/common/ResourcedEmoji.js +7 -6
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +21 -19
- package/dist/cjs/components/common/SpriteEmoji.js +66 -0
- package/dist/cjs/components/common/ToneSelector.js +8 -134
- package/dist/cjs/components/common/ToneSelectorInternal.js +142 -0
- package/dist/cjs/components/common/ToolTipContentWithKeymap.js +2 -2
- package/dist/cjs/components/common/UnicodeEmoji.js +137 -0
- package/dist/cjs/components/common/UploadEmoji.js +9 -8
- package/dist/cjs/components/common/emojiPlaceholderTestId.js +14 -0
- package/dist/cjs/components/common/handleDelete.js +19 -0
- package/dist/cjs/components/common/isRefreshEmojiPickerEnabled.js +22 -0
- package/dist/cjs/components/picker/AbstractItem.js +14 -0
- package/dist/cjs/components/picker/CategoryHeadingItem.js +36 -0
- package/dist/cjs/components/picker/CategorySelector.js +10 -16
- package/dist/cjs/components/picker/EmojiPicker.js +48 -110
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +3 -3
- package/dist/cjs/components/picker/EmojiPickerComponent.js +58 -42
- package/dist/cjs/components/picker/EmojiPickerInternal.js +99 -0
- package/dist/cjs/components/picker/EmojiPickerList.js +35 -30
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +1 -95
- package/dist/cjs/components/picker/EmojisRowItem.js +39 -0
- package/dist/cjs/components/picker/LoadingItem.js +42 -0
- package/dist/cjs/components/picker/NoResultsItem.js +36 -0
- package/dist/cjs/components/picker/categorySelectorCategoryTestId.js +14 -0
- package/dist/cjs/components/picker/{utils.js → emojiPickerHeightOffset.js} +1 -7
- package/dist/cjs/components/picker/emojiPickerLoader.js +17 -0
- package/dist/cjs/components/picker/emojiPickerModuleLoader.js +19 -0
- package/dist/cjs/components/picker/preloadEmojiPicker.js +18 -0
- package/dist/cjs/components/picker/scrollToRow.js +11 -0
- package/dist/cjs/components/picker/sortCategories.js +15 -0
- package/dist/cjs/components/picker/sortCategoriesNew.js +15 -0
- package/dist/cjs/components/picker/virtualItemRenderer.js +19 -0
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +11 -8
- package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +17 -53
- package/dist/cjs/components/typeahead/EmojiTypeAheadItemInternal.js +58 -0
- package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +7 -6
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +11 -8
- package/dist/cjs/components/uploader/EmojiUploader.js +16 -63
- package/dist/cjs/components/uploader/EmojiUploaderInternal.js +66 -0
- package/dist/cjs/index.js +21 -18
- package/dist/cjs/util/actual-mouse-move.js +14 -0
- package/dist/cjs/util/analytics/Attributes.js +1 -0
- package/dist/cjs/util/analytics/CommonAttributes.js +1 -0
- package/dist/cjs/util/analytics/Duration.js +1 -0
- package/dist/cjs/util/analytics/aiGenerationCompletedEvent.js +12 -0
- package/dist/cjs/util/analytics/aiGenerationFailedEvent.js +12 -0
- package/dist/cjs/util/analytics/aiGenerationStartedEvent.js +15 -0
- package/dist/cjs/util/analytics/analytics.js +422 -228
- package/dist/cjs/util/analytics/categoryClickedEvent.js +12 -0
- package/dist/cjs/util/analytics/clearSampled.js +24 -0
- package/dist/cjs/util/analytics/closedPickerEvent.js +12 -0
- package/dist/cjs/util/analytics/createEvent.js +25 -0
- package/dist/cjs/util/analytics/deleteBeginEvent.js +12 -0
- package/dist/cjs/util/analytics/deleteCancelEvent.js +12 -0
- package/dist/cjs/util/analytics/deleteConfirmEvent.js +12 -0
- package/dist/cjs/util/analytics/emojiPickerEvent.js +12 -0
- package/dist/cjs/util/analytics/emojiUploaderEvent.js +10 -0
- package/dist/cjs/util/analytics/extractCommonAttributes.js +15 -0
- package/dist/cjs/util/analytics/extractErrorInfo.js +20 -0
- package/dist/cjs/util/analytics/getSkinTone.js +35 -0
- package/dist/cjs/util/analytics/hasUfoMarked.js +11 -0
- package/dist/cjs/util/analytics/isExperienceSampled.js +23 -0
- package/dist/cjs/util/analytics/openedPickerEvent.js +12 -0
- package/dist/cjs/util/analytics/pickerClickedEvent.js +15 -0
- package/dist/cjs/util/analytics/pickerSearchedEvent.js +12 -0
- package/dist/cjs/util/analytics/recordFailed.js +12 -0
- package/dist/cjs/util/analytics/recordFailedEmoji.js +19 -0
- package/dist/cjs/util/analytics/recordSelectionFailedSli.js +20 -0
- package/dist/cjs/util/analytics/recordSelectionSucceededSli.js +19 -0
- package/dist/cjs/util/analytics/recordSucceeded.js +12 -0
- package/dist/cjs/util/analytics/recordSucceededEmoji.js +19 -0
- package/dist/cjs/util/analytics/sampledUfoEmojiResourceFetched.js +11 -0
- package/dist/cjs/util/analytics/sampledUfoRenderedEmoji.js +11 -0
- package/dist/cjs/util/analytics/samplingUfo.js +30 -204
- package/dist/cjs/util/analytics/selectedFileEvent.js +12 -0
- package/dist/cjs/util/analytics/skinTones.js +22 -0
- package/dist/cjs/util/analytics/skintoneSelectorEvent.js +11 -0
- package/dist/cjs/util/analytics/toneSelectedEvent.js +12 -0
- package/dist/cjs/util/analytics/toneSelectorClosedEvent.js +12 -0
- package/dist/cjs/util/analytics/toneSelectorOpenedEvent.js +12 -0
- package/dist/cjs/util/analytics/typeaheadCancelledEvent.js +17 -0
- package/dist/cjs/util/analytics/typeaheadRenderedEvent.js +17 -0
- package/dist/cjs/util/analytics/typeaheadSelectedEvent.js +31 -0
- package/dist/cjs/util/analytics/ufoExperiences.js +37 -14
- package/dist/cjs/util/analytics/uploadBeginButton.js +12 -0
- package/dist/cjs/util/analytics/uploadCancelButton.js +12 -0
- package/dist/cjs/util/analytics/uploadConfirmButton.js +12 -0
- package/dist/cjs/util/analytics/uploadFailedEvent.js +12 -0
- package/dist/cjs/util/analytics/uploadSucceededEvent.js +12 -0
- package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +3 -3
- package/dist/cjs/util/analytics/withSampling.js +182 -0
- package/dist/cjs/util/build-emoji-description-with-alt-representation.js +19 -0
- package/dist/cjs/util/contains-emoji-id.js +18 -0
- package/dist/cjs/util/convert-image-to-media-representation.js +13 -0
- package/dist/cjs/util/convert-media-to-image-emoji.js +28 -0
- package/dist/cjs/util/convert-media-to-image-representation.js +13 -0
- package/dist/cjs/util/filter-hidden-emojis.js +12 -0
- package/dist/cjs/util/filters.js +2 -5
- package/dist/cjs/util/format-shortcut.js +30 -0
- package/dist/cjs/util/get-category-id.js +9 -0
- package/dist/cjs/util/get-tone-emoji.js +10 -0
- package/dist/cjs/util/has-data-url-image.js +11 -0
- package/dist/cjs/util/is-emoji-description-with-variations.js +9 -0
- package/dist/cjs/util/is-emoji-description.js +9 -0
- package/dist/cjs/util/is-emoji-id-equal.js +9 -0
- package/dist/cjs/util/is-emoji-variation-description.js +9 -0
- package/dist/cjs/util/{hidden-emojis.js → is-hidden-emoji.js} +1 -6
- package/dist/cjs/util/is-image-representation.js +9 -0
- package/dist/cjs/util/is-loaded-media-emoji.js +11 -0
- package/dist/cjs/util/is-media-emoji.js +10 -0
- package/dist/cjs/util/is-media-representation.js +9 -0
- package/dist/cjs/util/is-messages-key.js +10 -0
- package/dist/cjs/util/is-promise.js +9 -0
- package/dist/cjs/util/is-sprite-representation.js +9 -0
- package/dist/cjs/util/is-sprite-service-representation.js +9 -0
- package/dist/cjs/util/is-unicode-representation.js +9 -0
- package/dist/cjs/util/keymaps.js +3 -37
- package/dist/cjs/util/left-click.js +9 -0
- package/dist/cjs/util/make-key-map-with-common.js +16 -0
- package/dist/cjs/util/make-keymap.js +18 -0
- package/dist/cjs/util/mouse-location.js +12 -0
- package/dist/cjs/util/mouse.js +1 -26
- package/dist/cjs/util/to-emoji-id.js +13 -0
- package/dist/cjs/util/to-optional-emoji-id.js +13 -0
- package/dist/cjs/util/type-helpers.js +154 -115
- package/dist/cjs/utils.js +6 -5
- package/dist/es2019/admin.js +4 -0
- package/dist/es2019/api/EmojiLoader.js +2 -1
- package/dist/es2019/api/EmojiRepository.js +14 -18
- package/dist/es2019/api/EmojiResource.js +15 -17
- package/dist/es2019/api/EmojiUtils.js +43 -166
- package/dist/es2019/api/calculateScale.js +28 -0
- package/dist/es2019/api/denormaliseEmojiServiceResponse.js +35 -0
- package/dist/es2019/api/denormaliseServiceAltRepresentation.js +5 -0
- package/dist/es2019/api/denormaliseServiceRepresentation.js +46 -0
- package/dist/es2019/api/denormaliseSkinEmoji.js +22 -0
- package/dist/es2019/api/denormaliseStandardRepresentation.js +11 -0
- package/dist/es2019/api/emojiRequest.js +23 -0
- package/dist/es2019/api/getAltRepresentation.js +6 -0
- package/dist/es2019/api/getEmojiVariation.js +13 -0
- package/dist/es2019/api/getPixelRatio.js +6 -0
- package/dist/es2019/api/internal/AlphabeticalShortnameComparator.js +9 -0
- package/dist/es2019/api/internal/AsciiMatchComparator.js +19 -0
- package/dist/es2019/api/internal/ChainedEmojiComparator.js +21 -0
- package/dist/es2019/api/internal/Comparators.js +1 -222
- package/dist/es2019/api/internal/EmojiTypeComparator.js +25 -0
- package/dist/es2019/api/internal/ExactShortNameMatchComparator.js +22 -0
- package/dist/es2019/api/internal/Gateway.js +36 -0
- package/dist/es2019/api/internal/OrderComparator.js +12 -0
- package/dist/es2019/api/internal/QueryStringPositionMatchComparator.js +28 -0
- package/dist/es2019/api/internal/UsageFrequencyComparator.js +41 -0
- package/dist/es2019/api/internal/UsageFrequencyTracker.js +4 -39
- package/dist/es2019/api/internal/createSearchEmojiComparator.js +39 -0
- package/dist/es2019/api/internal/createUsageOnlyEmojiComparator.js +9 -0
- package/dist/es2019/api/isMediaApiUrl.js +1 -0
- package/dist/es2019/api/media/BrowserCacheStrategy.js +66 -0
- package/dist/es2019/api/media/MediaEmojiCache.js +8 -114
- package/dist/es2019/api/media/MemoryCacheStrategy.js +54 -0
- package/dist/es2019/api/media/SiteEmojiResource.js +10 -4
- package/dist/es2019/api/media/getRequiredRepresentation.js +1 -0
- package/dist/es2019/api/shouldUseAltRepresentation.js +3 -0
- package/dist/es2019/api/supportsUploadFeature.js +11 -0
- package/dist/es2019/components/common/AddOwnEmoji.compiled.css +6 -0
- package/dist/es2019/components/common/AddOwnEmoji.js +53 -0
- package/dist/es2019/components/common/CachingEmoji.js +7 -84
- package/dist/es2019/components/common/CachingMediaEmoji.js +84 -0
- package/dist/es2019/components/common/CreateEmojiWithRovo.js +3 -1
- package/dist/es2019/components/common/DeletableEmojiTooltipContent.js +2 -15
- package/dist/es2019/components/common/DeletableEmojiTooltipContentForScreenReader.js +16 -0
- package/dist/es2019/components/common/Emoji.js +16 -353
- package/dist/es2019/components/common/EmojiActions.compiled.css +0 -6
- package/dist/es2019/components/common/EmojiActions.js +9 -63
- package/dist/es2019/components/common/EmojiPlaceholder.js +8 -2
- package/dist/es2019/components/common/ImageEmoji.js +181 -0
- package/dist/es2019/components/common/RecordSelectionDefault.js +4 -2
- package/dist/es2019/components/common/ResourcedEmoji.js +3 -2
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +10 -8
- package/dist/es2019/components/common/SpriteEmoji.js +58 -0
- package/dist/es2019/components/common/ToneSelector.js +8 -127
- package/dist/es2019/components/common/ToneSelectorInternal.js +129 -0
- package/dist/es2019/components/common/ToolTipContentWithKeymap.js +1 -1
- package/dist/es2019/components/common/UnicodeEmoji.js +125 -0
- package/dist/es2019/components/common/UploadEmoji.js +5 -4
- package/dist/es2019/components/common/emojiPlaceholderTestId.js +6 -0
- package/dist/es2019/components/common/handleDelete.js +15 -0
- package/dist/es2019/components/common/isRefreshEmojiPickerEnabled.js +15 -0
- package/dist/es2019/components/picker/AbstractItem.js +6 -0
- package/dist/es2019/components/picker/CategoryHeadingItem.js +13 -0
- package/dist/es2019/components/picker/CategorySelector.js +6 -6
- package/dist/es2019/components/picker/EmojiPicker.js +25 -78
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +33 -17
- package/dist/es2019/components/picker/EmojiPickerInternal.js +71 -0
- package/dist/es2019/components/picker/EmojiPickerList.js +13 -8
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +1 -58
- package/dist/es2019/components/picker/EmojisRowItem.js +16 -0
- package/dist/es2019/components/picker/LoadingItem.js +19 -0
- package/dist/es2019/components/picker/NoResultsItem.js +13 -0
- package/dist/es2019/components/picker/categorySelectorCategoryTestId.js +6 -0
- package/dist/es2019/components/picker/emojiPickerHeightOffset.js +9 -0
- package/dist/es2019/components/picker/emojiPickerLoader.js +7 -0
- package/dist/es2019/components/picker/emojiPickerModuleLoader.js +6 -0
- package/dist/es2019/components/picker/preloadEmojiPicker.js +12 -0
- package/dist/es2019/components/picker/{utils.js → scrollToRow.js} +0 -10
- package/dist/es2019/components/picker/sortCategories.js +7 -0
- package/dist/es2019/components/picker/sortCategoriesNew.js +7 -0
- package/dist/es2019/components/picker/virtualItemRenderer.js +13 -0
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +5 -2
- package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +11 -49
- package/dist/es2019/components/typeahead/EmojiTypeAheadItemInternal.js +50 -0
- package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +4 -3
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +6 -3
- package/dist/es2019/components/uploader/EmojiUploader.js +10 -33
- package/dist/es2019/components/uploader/EmojiUploaderInternal.js +31 -0
- package/dist/es2019/element.js +10 -0
- package/dist/es2019/index.js +12 -8
- package/dist/es2019/picker.js +4 -0
- package/dist/es2019/resource.js +18 -0
- package/dist/es2019/typeahead.js +7 -0
- package/dist/es2019/util/actual-mouse-move.js +8 -0
- package/dist/es2019/util/analytics/Attributes.js +0 -0
- package/dist/es2019/util/analytics/CommonAttributes.js +0 -0
- package/dist/es2019/util/analytics/Duration.js +0 -0
- package/dist/es2019/util/analytics/aiGenerationCompletedEvent.js +4 -0
- package/dist/es2019/util/analytics/aiGenerationFailedEvent.js +4 -0
- package/dist/es2019/util/analytics/aiGenerationStartedEvent.js +5 -0
- package/dist/es2019/util/analytics/analytics.js +157 -155
- package/dist/es2019/util/analytics/categoryClickedEvent.js +4 -0
- package/dist/es2019/util/analytics/clearSampled.js +6 -0
- package/dist/es2019/util/analytics/closedPickerEvent.js +4 -0
- package/dist/es2019/util/analytics/createEvent.js +13 -0
- package/dist/es2019/util/analytics/deleteBeginEvent.js +4 -0
- package/dist/es2019/util/analytics/deleteCancelEvent.js +4 -0
- package/dist/es2019/util/analytics/deleteConfirmEvent.js +4 -0
- package/dist/es2019/util/analytics/emojiPickerEvent.js +2 -0
- package/dist/es2019/util/analytics/emojiUploaderEvent.js +2 -0
- package/dist/es2019/util/analytics/extractCommonAttributes.js +7 -0
- package/dist/es2019/util/analytics/extractErrorInfo.js +14 -0
- package/dist/es2019/util/analytics/getSkinTone.js +18 -0
- package/dist/es2019/util/analytics/hasUfoMarked.js +3 -0
- package/dist/es2019/util/analytics/isExperienceSampled.js +17 -0
- package/dist/es2019/util/analytics/openedPickerEvent.js +4 -0
- package/dist/es2019/util/analytics/pickerClickedEvent.js +8 -0
- package/dist/es2019/util/analytics/pickerSearchedEvent.js +4 -0
- package/dist/es2019/util/analytics/recordFailed.js +6 -0
- package/dist/es2019/util/analytics/recordFailedEmoji.js +11 -0
- package/dist/es2019/util/analytics/recordSelectionFailedSli.js +12 -0
- package/dist/es2019/util/analytics/recordSelectionSucceededSli.js +11 -0
- package/dist/es2019/util/analytics/recordSucceeded.js +6 -0
- package/dist/es2019/util/analytics/recordSucceededEmoji.js +11 -0
- package/dist/es2019/util/analytics/sampledUfoEmojiResourceFetched.js +5 -0
- package/dist/es2019/util/analytics/sampledUfoRenderedEmoji.js +5 -0
- package/dist/es2019/util/analytics/samplingUfo.js +10 -121
- package/dist/es2019/util/analytics/selectedFileEvent.js +4 -0
- package/dist/es2019/util/analytics/skinTones.js +16 -0
- package/dist/es2019/util/analytics/skintoneSelectorEvent.js +2 -0
- package/dist/es2019/util/analytics/toneSelectedEvent.js +4 -0
- package/dist/es2019/util/analytics/toneSelectorClosedEvent.js +4 -0
- package/dist/es2019/util/analytics/toneSelectorOpenedEvent.js +4 -0
- package/dist/es2019/util/analytics/typeaheadCancelledEvent.js +8 -0
- package/dist/es2019/util/analytics/typeaheadRenderedEvent.js +8 -0
- package/dist/es2019/util/analytics/typeaheadSelectedEvent.js +20 -0
- package/dist/es2019/util/analytics/ufoExperiences.js +15 -11
- package/dist/es2019/util/analytics/uploadBeginButton.js +4 -0
- package/dist/es2019/util/analytics/uploadCancelButton.js +4 -0
- package/dist/es2019/util/analytics/uploadConfirmButton.js +4 -0
- package/dist/es2019/util/analytics/uploadFailedEvent.js +4 -0
- package/dist/es2019/util/analytics/uploadSucceededEvent.js +4 -0
- package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +1 -1
- package/dist/es2019/util/analytics/withSampling.js +104 -0
- package/dist/es2019/util/build-emoji-description-with-alt-representation.js +10 -0
- package/dist/es2019/util/contains-emoji-id.js +12 -0
- package/dist/es2019/util/convert-image-to-media-representation.js +5 -0
- package/dist/es2019/util/convert-media-to-image-emoji.js +19 -0
- package/dist/es2019/util/convert-media-to-image-representation.js +5 -0
- package/dist/es2019/util/filter-hidden-emojis.js +2 -0
- package/dist/es2019/util/filters.js +1 -2
- package/dist/es2019/util/format-shortcut.js +23 -0
- package/dist/es2019/util/get-category-id.js +1 -0
- package/dist/es2019/util/get-tone-emoji.js +2 -0
- package/dist/es2019/util/has-data-url-image.js +3 -0
- package/dist/es2019/util/is-emoji-description-with-variations.js +1 -0
- package/dist/es2019/util/is-emoji-description.js +1 -0
- package/dist/es2019/util/is-emoji-id-equal.js +1 -0
- package/dist/es2019/util/is-emoji-variation-description.js +3 -0
- package/dist/es2019/util/{hidden-emojis.js → is-hidden-emoji.js} +1 -2
- package/dist/es2019/util/is-image-representation.js +1 -0
- package/dist/es2019/util/is-loaded-media-emoji.js +3 -0
- package/dist/es2019/util/is-media-emoji.js +2 -0
- package/dist/es2019/util/is-media-representation.js +1 -0
- package/dist/es2019/util/is-messages-key.js +2 -0
- package/dist/es2019/util/is-promise.js +1 -0
- package/dist/es2019/util/is-sprite-representation.js +1 -0
- package/dist/es2019/util/is-sprite-service-representation.js +1 -0
- package/dist/es2019/util/is-unicode-representation.js +1 -0
- package/dist/es2019/util/keymaps.js +2 -32
- package/dist/es2019/util/left-click.js +3 -0
- package/dist/es2019/util/make-key-map-with-common.js +10 -0
- package/dist/es2019/util/make-keymap.js +12 -0
- package/dist/es2019/util/mouse-location.js +6 -0
- package/dist/es2019/util/mouse.js +0 -18
- package/dist/es2019/util/to-emoji-id.js +5 -0
- package/dist/es2019/util/to-optional-emoji-id.js +7 -0
- package/dist/es2019/util/type-helpers.js +89 -78
- package/dist/es2019/utils.js +16 -2
- package/dist/esm/admin.js +4 -0
- package/dist/esm/api/EmojiLoader.js +2 -1
- package/dist/esm/api/EmojiRepository.js +14 -18
- package/dist/esm/api/EmojiResource.js +14 -17
- package/dist/esm/api/EmojiUtils.js +43 -167
- package/dist/esm/api/calculateScale.js +28 -0
- package/dist/esm/api/denormaliseEmojiServiceResponse.js +37 -0
- package/dist/esm/api/denormaliseServiceAltRepresentation.js +5 -0
- package/dist/esm/api/denormaliseServiceRepresentation.js +43 -0
- package/dist/esm/api/denormaliseSkinEmoji.js +24 -0
- package/dist/esm/api/denormaliseStandardRepresentation.js +11 -0
- package/dist/esm/api/emojiRequest.js +25 -0
- package/dist/esm/api/getAltRepresentation.js +6 -0
- package/dist/esm/api/getEmojiVariation.js +13 -0
- package/dist/esm/api/getPixelRatio.js +6 -0
- package/dist/esm/api/internal/AlphabeticalShortnameComparator.js +18 -0
- package/dist/esm/api/internal/AsciiMatchComparator.js +25 -0
- package/dist/esm/api/internal/ChainedEmojiComparator.js +30 -0
- package/dist/esm/api/internal/Comparators.js +1 -275
- package/dist/esm/api/internal/EmojiTypeComparator.js +33 -0
- package/dist/esm/api/internal/ExactShortNameMatchComparator.js +28 -0
- package/dist/esm/api/internal/Gateway.js +45 -0
- package/dist/esm/api/internal/OrderComparator.js +21 -0
- package/dist/esm/api/internal/QueryStringPositionMatchComparator.js +36 -0
- package/dist/esm/api/internal/UsageFrequencyComparator.js +52 -0
- package/dist/esm/api/internal/UsageFrequencyTracker.js +4 -46
- package/dist/esm/api/internal/createSearchEmojiComparator.js +40 -0
- package/dist/esm/api/internal/createUsageOnlyEmojiComparator.js +9 -0
- package/dist/esm/api/isMediaApiUrl.js +3 -0
- package/dist/esm/api/media/BrowserCacheStrategy.js +80 -0
- package/dist/esm/api/media/MediaEmojiCache.js +18 -143
- package/dist/esm/api/media/MemoryCacheStrategy.js +61 -0
- package/dist/esm/api/media/SiteEmojiResource.js +10 -4
- package/dist/esm/api/media/getRequiredRepresentation.js +3 -0
- package/dist/esm/api/shouldUseAltRepresentation.js +7 -0
- package/dist/esm/api/supportsUploadFeature.js +11 -0
- package/dist/esm/components/common/AddOwnEmoji.compiled.css +6 -0
- package/dist/esm/components/common/AddOwnEmoji.js +53 -0
- package/dist/esm/components/common/CachingEmoji.js +8 -87
- package/dist/esm/components/common/CachingMediaEmoji.js +88 -0
- package/dist/esm/components/common/CreateEmojiWithRovo.js +3 -1
- package/dist/esm/components/common/DeletableEmojiTooltipContent.js +2 -14
- package/dist/esm/components/common/DeletableEmojiTooltipContentForScreenReader.js +15 -0
- package/dist/esm/components/common/Emoji.js +17 -359
- package/dist/esm/components/common/EmojiActions.compiled.css +0 -6
- package/dist/esm/components/common/EmojiActions.js +9 -63
- package/dist/esm/components/common/EmojiPlaceholder.js +8 -4
- package/dist/esm/components/common/ImageEmoji.js +189 -0
- package/dist/esm/components/common/RecordSelectionDefault.js +4 -2
- package/dist/esm/components/common/ResourcedEmoji.js +3 -2
- package/dist/esm/components/common/ResourcedEmojiComponent.js +10 -8
- package/dist/esm/components/common/SpriteEmoji.js +58 -0
- package/dist/esm/components/common/ToneSelector.js +8 -131
- package/dist/esm/components/common/ToneSelectorInternal.js +133 -0
- package/dist/esm/components/common/ToolTipContentWithKeymap.js +1 -1
- package/dist/esm/components/common/UnicodeEmoji.js +128 -0
- package/dist/esm/components/common/UploadEmoji.js +5 -4
- package/dist/esm/components/common/emojiPlaceholderTestId.js +8 -0
- package/dist/esm/components/common/handleDelete.js +13 -0
- package/dist/esm/components/common/isRefreshEmojiPickerEnabled.js +15 -0
- package/dist/esm/components/picker/AbstractItem.js +7 -0
- package/dist/esm/components/picker/CategoryHeadingItem.js +27 -0
- package/dist/esm/components/picker/CategorySelector.js +6 -12
- package/dist/esm/components/picker/EmojiPicker.js +25 -105
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +33 -17
- package/dist/esm/components/picker/EmojiPickerInternal.js +92 -0
- package/dist/esm/components/picker/EmojiPickerList.js +13 -8
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +1 -90
- package/dist/esm/components/picker/EmojisRowItem.js +30 -0
- package/dist/esm/components/picker/LoadingItem.js +33 -0
- package/dist/esm/components/picker/NoResultsItem.js +27 -0
- package/dist/esm/components/picker/categorySelectorCategoryTestId.js +8 -0
- package/dist/esm/components/picker/emojiPickerHeightOffset.js +9 -0
- package/dist/esm/components/picker/emojiPickerLoader.js +11 -0
- package/dist/esm/components/picker/emojiPickerModuleLoader.js +8 -0
- package/dist/esm/components/picker/preloadEmojiPicker.js +12 -0
- package/dist/esm/components/picker/{utils.js → scrollToRow.js} +0 -10
- package/dist/esm/components/picker/sortCategories.js +9 -0
- package/dist/esm/components/picker/sortCategoriesNew.js +9 -0
- package/dist/esm/components/picker/virtualItemRenderer.js +11 -0
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +5 -2
- package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +11 -50
- package/dist/esm/components/typeahead/EmojiTypeAheadItemInternal.js +51 -0
- package/dist/esm/components/typeahead/EmojiTypeAheadList.js +4 -3
- package/dist/esm/components/uploader/EmojiUploadComponent.js +6 -3
- package/dist/esm/components/uploader/EmojiUploader.js +10 -57
- package/dist/esm/components/uploader/EmojiUploaderInternal.js +55 -0
- package/dist/esm/element.js +10 -0
- package/dist/esm/index.js +12 -8
- package/dist/esm/picker.js +4 -0
- package/dist/esm/resource.js +18 -0
- package/dist/esm/typeahead.js +7 -0
- package/dist/esm/util/actual-mouse-move.js +8 -0
- package/dist/esm/util/analytics/Attributes.js +0 -0
- package/dist/esm/util/analytics/CommonAttributes.js +0 -0
- package/dist/esm/util/analytics/Duration.js +0 -0
- package/dist/esm/util/analytics/aiGenerationCompletedEvent.js +6 -0
- package/dist/esm/util/analytics/aiGenerationFailedEvent.js +6 -0
- package/dist/esm/util/analytics/aiGenerationStartedEvent.js +9 -0
- package/dist/esm/util/analytics/analytics.js +157 -223
- package/dist/esm/util/analytics/categoryClickedEvent.js +6 -0
- package/dist/esm/util/analytics/clearSampled.js +18 -0
- package/dist/esm/util/analytics/closedPickerEvent.js +6 -0
- package/dist/esm/util/analytics/createEvent.js +18 -0
- package/dist/esm/util/analytics/deleteBeginEvent.js +6 -0
- package/dist/esm/util/analytics/deleteCancelEvent.js +6 -0
- package/dist/esm/util/analytics/deleteConfirmEvent.js +6 -0
- package/dist/esm/util/analytics/emojiPickerEvent.js +6 -0
- package/dist/esm/util/analytics/emojiUploaderEvent.js +4 -0
- package/dist/esm/util/analytics/extractCommonAttributes.js +9 -0
- package/dist/esm/util/analytics/extractErrorInfo.js +14 -0
- package/dist/esm/util/analytics/getSkinTone.js +29 -0
- package/dist/esm/util/analytics/hasUfoMarked.js +5 -0
- package/dist/esm/util/analytics/isExperienceSampled.js +17 -0
- package/dist/esm/util/analytics/openedPickerEvent.js +6 -0
- package/dist/esm/util/analytics/pickerClickedEvent.js +10 -0
- package/dist/esm/util/analytics/pickerSearchedEvent.js +6 -0
- package/dist/esm/util/analytics/recordFailed.js +6 -0
- package/dist/esm/util/analytics/recordFailedEmoji.js +13 -0
- package/dist/esm/util/analytics/recordSelectionFailedSli.js +14 -0
- package/dist/esm/util/analytics/recordSelectionSucceededSli.js +13 -0
- package/dist/esm/util/analytics/recordSucceeded.js +6 -0
- package/dist/esm/util/analytics/recordSucceededEmoji.js +13 -0
- package/dist/esm/util/analytics/sampledUfoEmojiResourceFetched.js +5 -0
- package/dist/esm/util/analytics/sampledUfoRenderedEmoji.js +5 -0
- package/dist/esm/util/analytics/samplingUfo.js +10 -204
- package/dist/esm/util/analytics/selectedFileEvent.js +6 -0
- package/dist/esm/util/analytics/skinTones.js +16 -0
- package/dist/esm/util/analytics/skintoneSelectorEvent.js +5 -0
- package/dist/esm/util/analytics/toneSelectedEvent.js +6 -0
- package/dist/esm/util/analytics/toneSelectorClosedEvent.js +6 -0
- package/dist/esm/util/analytics/toneSelectorOpenedEvent.js +6 -0
- package/dist/esm/util/analytics/typeaheadCancelledEvent.js +12 -0
- package/dist/esm/util/analytics/typeaheadRenderedEvent.js +12 -0
- package/dist/esm/util/analytics/typeaheadSelectedEvent.js +26 -0
- package/dist/esm/util/analytics/ufoExperiences.js +15 -13
- package/dist/esm/util/analytics/uploadBeginButton.js +6 -0
- package/dist/esm/util/analytics/uploadCancelButton.js +6 -0
- package/dist/esm/util/analytics/uploadConfirmButton.js +6 -0
- package/dist/esm/util/analytics/uploadFailedEvent.js +6 -0
- package/dist/esm/util/analytics/uploadSucceededEvent.js +6 -0
- package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +1 -1
- package/dist/esm/util/analytics/withSampling.js +175 -0
- package/dist/esm/util/build-emoji-description-with-alt-representation.js +12 -0
- package/dist/esm/util/contains-emoji-id.js +12 -0
- package/dist/esm/util/convert-image-to-media-representation.js +7 -0
- package/dist/esm/util/convert-media-to-image-emoji.js +21 -0
- package/dist/esm/util/convert-media-to-image-representation.js +7 -0
- package/dist/esm/util/filter-hidden-emojis.js +6 -0
- package/dist/esm/util/filters.js +1 -4
- package/dist/esm/util/format-shortcut.js +23 -0
- package/dist/esm/util/get-category-id.js +3 -0
- package/dist/esm/util/get-tone-emoji.js +4 -0
- package/dist/esm/util/has-data-url-image.js +5 -0
- package/dist/esm/util/is-emoji-description-with-variations.js +3 -0
- package/dist/esm/util/is-emoji-description.js +3 -0
- package/dist/esm/util/is-emoji-id-equal.js +3 -0
- package/dist/esm/util/is-emoji-variation-description.js +3 -0
- package/dist/esm/util/{hidden-emojis.js → is-hidden-emoji.js} +0 -5
- package/dist/esm/util/is-image-representation.js +3 -0
- package/dist/esm/util/is-loaded-media-emoji.js +5 -0
- package/dist/esm/util/is-media-emoji.js +4 -0
- package/dist/esm/util/is-media-representation.js +3 -0
- package/dist/esm/util/is-messages-key.js +4 -0
- package/dist/esm/util/is-promise.js +3 -0
- package/dist/esm/util/is-sprite-representation.js +3 -0
- package/dist/esm/util/is-sprite-service-representation.js +3 -0
- package/dist/esm/util/is-unicode-representation.js +3 -0
- package/dist/esm/util/keymaps.js +2 -32
- package/dist/esm/util/left-click.js +3 -0
- package/dist/esm/util/make-key-map-with-common.js +10 -0
- package/dist/esm/util/make-keymap.js +12 -0
- package/dist/esm/util/mouse-location.js +6 -0
- package/dist/esm/util/mouse.js +0 -18
- package/dist/esm/util/to-emoji-id.js +7 -0
- package/dist/esm/util/to-optional-emoji-id.js +7 -0
- package/dist/esm/util/type-helpers.js +89 -113
- package/dist/esm/utils.js +16 -2
- package/dist/types/admin.d.ts +3 -0
- package/dist/types/api/EmojiLoader.d.ts +1 -1
- package/dist/types/api/EmojiRepository.d.ts +4 -1
- package/dist/types/api/EmojiResource.d.ts +5 -9
- package/dist/types/api/EmojiUtils.d.ts +46 -15
- package/dist/types/api/calculateScale.d.ts +2 -0
- package/dist/types/api/denormaliseEmojiServiceResponse.d.ts +6 -0
- package/dist/types/api/denormaliseServiceAltRepresentation.d.ts +2 -0
- package/dist/types/api/denormaliseServiceRepresentation.d.ts +2 -0
- package/dist/types/api/denormaliseSkinEmoji.d.ts +2 -0
- package/dist/types/api/denormaliseStandardRepresentation.d.ts +2 -0
- package/dist/types/api/emojiRequest.d.ts +4 -0
- package/dist/types/api/getAltRepresentation.d.ts +2 -0
- package/dist/types/api/getEmojiVariation.d.ts +2 -0
- package/dist/types/api/getPixelRatio.d.ts +1 -0
- package/dist/types/api/internal/AlphabeticalShortnameComparator.d.ts +8 -0
- package/dist/types/api/internal/AsciiMatchComparator.d.ts +11 -0
- package/dist/types/api/internal/ChainedEmojiComparator.d.ts +14 -0
- package/dist/types/api/internal/Comparators.d.ts +0 -98
- package/dist/types/api/internal/EmojiTypeComparator.d.ts +14 -0
- package/dist/types/api/internal/ExactShortNameMatchComparator.d.ts +12 -0
- package/dist/types/api/internal/Gateway.d.ts +13 -0
- package/dist/types/api/internal/OrderComparator.d.ts +8 -0
- package/dist/types/api/internal/QueryStringPositionMatchComparator.d.ts +21 -0
- package/dist/types/api/internal/UsageFrequencyComparator.d.ts +17 -0
- package/dist/types/api/internal/UsageFrequencyTracker.d.ts +0 -13
- package/dist/types/api/internal/createSearchEmojiComparator.d.ts +9 -0
- package/dist/types/api/internal/createUsageOnlyEmojiComparator.d.ts +2 -0
- package/dist/types/api/isMediaApiUrl.d.ts +2 -0
- package/dist/types/api/media/BrowserCacheStrategy.d.ts +15 -0
- package/dist/types/api/media/MediaEmojiCache.d.ts +2 -29
- package/dist/types/api/media/MemoryCacheStrategy.d.ts +19 -0
- package/dist/types/api/media/getRequiredRepresentation.d.ts +2 -0
- package/dist/types/api/shouldUseAltRepresentation.d.ts +2 -0
- package/dist/types/api/supportsUploadFeature.d.ts +9 -0
- package/dist/types/components/common/AddOwnEmoji.d.ts +9 -0
- package/dist/types/components/common/CachingEmoji.d.ts +0 -5
- package/dist/types/components/common/CachingMediaEmoji.d.ts +7 -0
- package/dist/types/components/common/DeletableEmojiTooltipContent.d.ts +0 -4
- package/dist/types/components/common/DeletableEmojiTooltipContentForScreenReader.d.ts +1 -0
- package/dist/types/components/common/Emoji.d.ts +1 -3
- package/dist/types/components/common/EmojiActions.d.ts +4 -6
- package/dist/types/components/common/EmojiPlaceholder.d.ts +8 -1
- package/dist/types/components/common/ImageEmoji.d.ts +6 -0
- package/dist/types/components/common/RecordSelectionDefault.d.ts +2 -2
- package/dist/types/components/common/SpriteEmoji.d.ts +6 -0
- package/dist/types/components/common/ToneSelector.d.ts +6 -3
- package/dist/types/components/common/ToneSelectorInternal.d.ts +9 -0
- package/dist/types/components/common/ToolTipContentWithKeymap.d.ts +1 -1
- package/dist/types/components/common/UnicodeEmoji.d.ts +6 -0
- package/dist/types/components/common/UploadEmoji.d.ts +2 -2
- package/dist/types/components/common/emojiPlaceholderTestId.d.ts +5 -0
- package/dist/types/components/common/handleDelete.d.ts +5 -0
- package/dist/types/components/common/isRefreshEmojiPickerEnabled.d.ts +5 -0
- package/dist/types/components/picker/AbstractItem.d.ts +7 -0
- package/dist/types/components/picker/CategoryHeadingItem.d.ts +10 -0
- package/dist/types/components/picker/CategorySelector.d.ts +5 -4
- package/dist/types/components/picker/EmojiPicker.d.ts +19 -19
- package/dist/types/components/picker/EmojiPickerCategoryHeading.d.ts +4 -0
- package/dist/types/components/picker/EmojiPickerComponent.d.ts +6 -2
- package/dist/types/components/picker/EmojiPickerInternal.d.ts +24 -0
- package/dist/types/components/picker/EmojiPickerList.d.ts +5 -5
- package/dist/types/components/picker/EmojiPickerVirtualItems.d.ts +0 -26
- package/dist/types/components/picker/EmojisRowItem.d.ts +11 -0
- package/dist/types/components/picker/LoadingItem.d.ts +9 -0
- package/dist/types/components/picker/NoResultsItem.d.ts +10 -0
- package/dist/types/components/picker/categorySelectorCategoryTestId.d.ts +5 -0
- package/dist/types/components/picker/{utils.d.ts → emojiPickerHeightOffset.d.ts} +0 -1
- package/dist/types/components/picker/emojiPickerLoader.d.ts +7 -0
- package/dist/types/components/picker/emojiPickerModuleLoader.d.ts +5 -0
- package/dist/types/components/picker/preloadEmojiPicker.d.ts +5 -0
- package/dist/types/components/picker/scrollToRow.d.ts +1 -0
- package/dist/types/components/picker/sortCategories.d.ts +6 -0
- package/dist/types/components/picker/sortCategoriesNew.d.ts +6 -0
- package/dist/types/components/picker/virtualItemRenderer.d.ts +10 -0
- package/dist/types/components/typeahead/EmojiTypeAheadComponent.d.ts +3 -3
- package/dist/types/components/typeahead/EmojiTypeAheadItem.d.ts +7 -2
- package/dist/types/components/typeahead/EmojiTypeAheadItemInternal.d.ts +6 -0
- package/dist/types/components/uploader/EmojiUploadComponent.d.ts +3 -3
- package/dist/types/components/uploader/EmojiUploader.d.ts +8 -14
- package/dist/types/components/uploader/EmojiUploaderInternal.d.ts +14 -0
- package/dist/types/element.d.ts +9 -0
- package/dist/types/index.d.ts +13 -8
- package/dist/types/picker.d.ts +3 -0
- package/dist/types/resource.d.ts +15 -0
- package/dist/types/typeahead.d.ts +6 -0
- package/dist/types/util/actual-mouse-move.d.ts +2 -0
- package/dist/types/util/analytics/Attributes.d.ts +3 -0
- package/dist/types/util/analytics/CommonAttributes.d.ts +5 -0
- package/dist/types/util/analytics/Duration.d.ts +3 -0
- package/dist/types/util/analytics/aiGenerationCompletedEvent.d.ts +3 -0
- package/dist/types/util/analytics/aiGenerationFailedEvent.d.ts +4 -0
- package/dist/types/util/analytics/aiGenerationStartedEvent.d.ts +4 -0
- package/dist/types/util/analytics/analytics.d.ts +162 -74
- package/dist/types/util/analytics/categoryClickedEvent.d.ts +4 -0
- package/dist/types/util/analytics/clearSampled.d.ts +1 -0
- package/dist/types/util/analytics/closedPickerEvent.d.ts +3 -0
- package/dist/types/util/analytics/createEvent.d.ts +2 -0
- package/dist/types/util/analytics/deleteBeginEvent.d.ts +3 -0
- package/dist/types/util/analytics/deleteCancelEvent.d.ts +3 -0
- package/dist/types/util/analytics/deleteConfirmEvent.d.ts +3 -0
- package/dist/types/util/analytics/emojiPickerEvent.d.ts +1 -0
- package/dist/types/util/analytics/emojiUploaderEvent.d.ts +1 -0
- package/dist/types/util/analytics/extractCommonAttributes.d.ts +3 -0
- package/dist/types/util/analytics/extractErrorInfo.d.ts +6 -0
- package/dist/types/util/analytics/getSkinTone.d.ts +1 -0
- package/dist/types/util/analytics/hasUfoMarked.d.ts +3 -0
- package/dist/types/util/analytics/isExperienceSampled.d.ts +8 -0
- package/dist/types/util/analytics/openedPickerEvent.d.ts +2 -0
- package/dist/types/util/analytics/pickerClickedEvent.d.ts +13 -0
- package/dist/types/util/analytics/pickerSearchedEvent.d.ts +5 -0
- package/dist/types/util/analytics/recordFailed.d.ts +2 -0
- package/dist/types/util/analytics/recordFailedEmoji.d.ts +1 -0
- package/dist/types/util/analytics/recordSelectionFailedSli.d.ts +1 -0
- package/dist/types/util/analytics/recordSelectionSucceededSli.d.ts +1 -0
- package/dist/types/util/analytics/recordSucceeded.d.ts +2 -0
- package/dist/types/util/analytics/recordSucceededEmoji.d.ts +1 -0
- package/dist/types/util/analytics/sampledUfoEmojiResourceFetched.d.ts +3 -0
- package/dist/types/util/analytics/sampledUfoRenderedEmoji.d.ts +3 -0
- package/dist/types/util/analytics/samplingUfo.d.ts +9 -15
- package/dist/types/util/analytics/selectedFileEvent.d.ts +2 -0
- package/dist/types/util/analytics/skinTones.d.ts +1 -0
- package/dist/types/util/analytics/skintoneSelectorEvent.d.ts +1 -0
- package/dist/types/util/analytics/toneSelectedEvent.d.ts +4 -0
- package/dist/types/util/analytics/toneSelectorClosedEvent.d.ts +2 -0
- package/dist/types/util/analytics/toneSelectorOpenedEvent.d.ts +4 -0
- package/dist/types/util/analytics/typeaheadCancelledEvent.d.ts +3 -0
- package/dist/types/util/analytics/typeaheadRenderedEvent.d.ts +3 -0
- package/dist/types/util/analytics/typeaheadSelectedEvent.d.ts +3 -0
- package/dist/types/util/analytics/ufoExperiences.d.ts +14 -7
- package/dist/types/util/analytics/uploadBeginButton.d.ts +2 -0
- package/dist/types/util/analytics/uploadCancelButton.d.ts +2 -0
- package/dist/types/util/analytics/uploadConfirmButton.d.ts +4 -0
- package/dist/types/util/analytics/uploadFailedEvent.d.ts +5 -0
- package/dist/types/util/analytics/uploadSucceededEvent.d.ts +3 -0
- package/dist/types/util/analytics/withSampling.d.ts +8 -0
- package/dist/types/util/build-emoji-description-with-alt-representation.d.ts +2 -0
- package/dist/types/util/contains-emoji-id.d.ts +2 -0
- package/dist/types/util/convert-image-to-media-representation.d.ts +2 -0
- package/dist/types/util/convert-media-to-image-emoji.d.ts +2 -0
- package/dist/types/util/convert-media-to-image-representation.d.ts +2 -0
- package/dist/types/util/{hidden-emojis.d.ts → filter-hidden-emojis.d.ts} +0 -1
- package/dist/types/util/filters.d.ts +2 -3
- package/dist/types/util/format-shortcut.d.ts +5 -0
- package/dist/types/util/get-category-id.d.ts +3 -0
- package/dist/types/util/get-tone-emoji.d.ts +3 -0
- package/dist/types/util/has-data-url-image.d.ts +2 -0
- package/dist/types/util/is-emoji-description-with-variations.d.ts +2 -0
- package/dist/types/util/is-emoji-description.d.ts +2 -0
- package/dist/types/util/is-emoji-id-equal.d.ts +2 -0
- package/dist/types/util/is-emoji-variation-description.d.ts +2 -0
- package/dist/types/util/is-hidden-emoji.d.ts +2 -0
- package/dist/types/util/is-image-representation.d.ts +2 -0
- package/dist/types/util/is-loaded-media-emoji.d.ts +2 -0
- package/dist/types/util/is-media-emoji.d.ts +2 -0
- package/dist/types/util/is-media-representation.d.ts +2 -0
- package/dist/types/util/is-messages-key.d.ts +2 -0
- package/dist/types/util/is-promise.d.ts +1 -0
- package/dist/types/util/is-sprite-representation.d.ts +2 -0
- package/dist/types/util/is-sprite-service-representation.d.ts +2 -0
- package/dist/types/util/is-unicode-representation.d.ts +2 -0
- package/dist/types/util/keymaps.d.ts +0 -3
- package/dist/types/util/left-click.d.ts +2 -0
- package/dist/types/util/make-key-map-with-common.d.ts +5 -0
- package/dist/types/util/make-keymap.d.ts +5 -0
- package/dist/types/util/mouse-location.d.ts +3 -0
- package/dist/types/util/mouse.d.ts +0 -4
- package/dist/types/util/to-emoji-id.d.ts +2 -0
- package/dist/types/util/to-optional-emoji-id.d.ts +2 -0
- package/dist/types/util/type-helpers.d.ts +88 -25
- package/dist/types/utils.d.ts +15 -2
- package/package.json +2 -2
- package/dist/cjs/i18n/index.js +0 -216
- package/dist/cjs/util/analytics/index.js +0 -231
- package/dist/es2019/i18n/index.js +0 -37
- package/dist/es2019/util/analytics/index.js +0 -4
- package/dist/esm/i18n/index.js +0 -37
- package/dist/esm/util/analytics/index.js +0 -4
- package/dist/types/i18n/index.d.ts +0 -37
- package/dist/types/util/analytics/index.d.ts +0 -6
- /package/dist/cjs/components/common/{ToneSelector.compiled.css → ToneSelectorInternal.compiled.css} +0 -0
- /package/dist/cjs/components/picker/{EmojiPicker.compiled.css → EmojiPickerInternal.compiled.css} +0 -0
- /package/dist/cjs/components/picker/{EmojiPickerVirtualItems.compiled.css → LoadingItem.compiled.css} +0 -0
- /package/dist/cjs/components/typeahead/{EmojiTypeAheadItem.compiled.css → EmojiTypeAheadItemInternal.compiled.css} +0 -0
- /package/dist/es2019/components/common/{ToneSelector.compiled.css → ToneSelectorInternal.compiled.css} +0 -0
- /package/dist/es2019/components/picker/{EmojiPicker.compiled.css → EmojiPickerInternal.compiled.css} +0 -0
- /package/dist/es2019/components/picker/{EmojiPickerVirtualItems.compiled.css → LoadingItem.compiled.css} +0 -0
- /package/dist/es2019/components/typeahead/{EmojiTypeAheadItem.compiled.css → EmojiTypeAheadItemInternal.compiled.css} +0 -0
- /package/dist/esm/components/common/{ToneSelector.compiled.css → ToneSelectorInternal.compiled.css} +0 -0
- /package/dist/esm/components/picker/{EmojiPicker.compiled.css → EmojiPickerInternal.compiled.css} +0 -0
- /package/dist/esm/components/picker/{EmojiPickerVirtualItems.compiled.css → LoadingItem.compiled.css} +0 -0
- /package/dist/esm/components/typeahead/{EmojiTypeAheadItem.compiled.css → EmojiTypeAheadItemInternal.compiled.css} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["representation", "skinVariations", "altRepresentations"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { buildEmojiDescriptionWithAltRepresentation } from '../util/build-emoji-description-with-alt-representation';
|
|
7
|
+
import { denormaliseServiceAltRepresentation } from './denormaliseServiceAltRepresentation';
|
|
8
|
+
import { denormaliseSkinEmoji } from './denormaliseSkinEmoji';
|
|
9
|
+
import { denormaliseStandardRepresentation } from './denormaliseStandardRepresentation';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Denormalised an emoji response (emojis + sprite references) into an array of
|
|
13
|
+
* emoji with local sprite definitions.
|
|
14
|
+
*/
|
|
15
|
+
export var denormaliseEmojiServiceResponse = function denormaliseEmojiServiceResponse(emojiData) {
|
|
16
|
+
var emojis = emojiData.emojis.map(function (emoji) {
|
|
17
|
+
var newRepresentation = denormaliseStandardRepresentation(emoji, emojiData.meta);
|
|
18
|
+
var altRepresentation = denormaliseServiceAltRepresentation(emoji.altRepresentations, emojiData.meta);
|
|
19
|
+
var newSkinVariations = denormaliseSkinEmoji(emoji, emojiData.meta);
|
|
20
|
+
|
|
21
|
+
// create trimmedServiceDesc which is emoji with no representations or skinVariations
|
|
22
|
+
var _representation = emoji.representation,
|
|
23
|
+
_skinVariations = emoji.skinVariations,
|
|
24
|
+
_altRepresentations = emoji.altRepresentations,
|
|
25
|
+
trimmedServiceDesc = _objectWithoutProperties(emoji, _excluded);
|
|
26
|
+
var response = _objectSpread(_objectSpread({}, trimmedServiceDesc), {}, {
|
|
27
|
+
representation: newRepresentation,
|
|
28
|
+
skinVariations: newSkinVariations
|
|
29
|
+
});
|
|
30
|
+
return buildEmojiDescriptionWithAltRepresentation(response, altRepresentation);
|
|
31
|
+
});
|
|
32
|
+
var mediaApiToken = emojiData.meta && emojiData.meta.mediaApiToken;
|
|
33
|
+
return {
|
|
34
|
+
emojis: emojis,
|
|
35
|
+
mediaApiToken: mediaApiToken
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { denormaliseServiceRepresentation } from './denormaliseServiceRepresentation';
|
|
2
|
+
import { getAltRepresentation } from './getAltRepresentation';
|
|
3
|
+
export var denormaliseServiceAltRepresentation = function denormaliseServiceAltRepresentation(altReps, meta) {
|
|
4
|
+
return !altReps || Object.keys(altReps).length === 0 ? undefined : denormaliseServiceRepresentation(getAltRepresentation(altReps), meta);
|
|
5
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { convertImageToMediaRepresentation } from '../util/convert-image-to-media-representation';
|
|
2
|
+
import { isImageRepresentation } from '../util/is-image-representation';
|
|
3
|
+
import { isSpriteServiceRepresentation } from '../util/is-sprite-service-representation';
|
|
4
|
+
import debug from '../util/logger';
|
|
5
|
+
import { isMediaApiUrl } from './isMediaApiUrl';
|
|
6
|
+
export var denormaliseServiceRepresentation = function denormaliseServiceRepresentation(representation, meta) {
|
|
7
|
+
if (isSpriteServiceRepresentation(representation) && meta && meta.spriteSheets) {
|
|
8
|
+
var _ref = representation,
|
|
9
|
+
height = _ref.height,
|
|
10
|
+
width = _ref.width,
|
|
11
|
+
x = _ref.x,
|
|
12
|
+
y = _ref.y,
|
|
13
|
+
xIndex = _ref.xIndex,
|
|
14
|
+
yIndex = _ref.yIndex,
|
|
15
|
+
spriteRef = _ref.spriteRef;
|
|
16
|
+
var spriteSheet = meta.spriteSheets[spriteRef];
|
|
17
|
+
if (spriteSheet) {
|
|
18
|
+
return {
|
|
19
|
+
sprite: spriteSheet,
|
|
20
|
+
height: height,
|
|
21
|
+
width: width,
|
|
22
|
+
x: x,
|
|
23
|
+
y: y,
|
|
24
|
+
xIndex: xIndex,
|
|
25
|
+
yIndex: yIndex
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
} else if (isImageRepresentation(representation)) {
|
|
29
|
+
var _height = representation.height,
|
|
30
|
+
_width = representation.width,
|
|
31
|
+
imagePath = representation.imagePath;
|
|
32
|
+
if (isMediaApiUrl(imagePath, meta)) {
|
|
33
|
+
return convertImageToMediaRepresentation(representation);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
height: _height,
|
|
37
|
+
width: _width,
|
|
38
|
+
imagePath: imagePath
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
debug('failed conversion for representation', representation, meta);
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["representation", "altRepresentations"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { denormaliseServiceAltRepresentation } from './denormaliseServiceAltRepresentation';
|
|
7
|
+
import { denormaliseStandardRepresentation } from './denormaliseStandardRepresentation';
|
|
8
|
+
export var denormaliseSkinEmoji = function denormaliseSkinEmoji(emoji, meta) {
|
|
9
|
+
if (!emoji.skinVariations) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
var skinEmoji = emoji.skinVariations;
|
|
13
|
+
var baseId = emoji.id;
|
|
14
|
+
return skinEmoji.map(function (skin) {
|
|
15
|
+
var _representation = skin.representation,
|
|
16
|
+
altRepresentations = skin.altRepresentations,
|
|
17
|
+
other = _objectWithoutProperties(skin, _excluded);
|
|
18
|
+
return _objectSpread({
|
|
19
|
+
baseId: baseId,
|
|
20
|
+
representation: denormaliseStandardRepresentation(skin, meta),
|
|
21
|
+
altRepresentation: denormaliseServiceAltRepresentation(altRepresentations, meta)
|
|
22
|
+
}, other);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
|
+
import { ProviderTypes } from '../types';
|
|
3
|
+
import { emojiIdToEmoji } from '../util/emojiIdToEmoji';
|
|
4
|
+
import { denormaliseServiceRepresentation } from './denormaliseServiceRepresentation';
|
|
5
|
+
export var denormaliseStandardRepresentation = function denormaliseStandardRepresentation(emoji, meta) {
|
|
6
|
+
var unicodeEmoji = emojiIdToEmoji(emoji.id);
|
|
7
|
+
var useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true));
|
|
8
|
+
return useUnicodeRepresentation ? {
|
|
9
|
+
unicodeEmoji: unicodeEmoji
|
|
10
|
+
} : denormaliseServiceRepresentation(emoji.representation, meta);
|
|
11
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["getRatio"],
|
|
4
|
+
_excluded2 = ["queryParams"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
8
|
+
import { calculateScale } from './calculateScale';
|
|
9
|
+
import { getPixelRatio } from './getPixelRatio';
|
|
10
|
+
export var emojiRequest = function emojiRequest(provider, options) {
|
|
11
|
+
var _provider$getRatio = provider.getRatio,
|
|
12
|
+
getRatio = _provider$getRatio === void 0 ? getPixelRatio : _provider$getRatio,
|
|
13
|
+
serviceConfig = _objectWithoutProperties(provider, _excluded);
|
|
14
|
+
var scaleQueryParams = calculateScale(getRatio);
|
|
15
|
+
var _ref = options || {},
|
|
16
|
+
_ref$queryParams = _ref.queryParams,
|
|
17
|
+
queryParams = _ref$queryParams === void 0 ? {} : _ref$queryParams,
|
|
18
|
+
otherOptions = _objectWithoutProperties(_ref, _excluded2);
|
|
19
|
+
var requestOptions = _objectSpread(_objectSpread({}, otherOptions), {}, {
|
|
20
|
+
queryParams: _objectSpread(_objectSpread(_objectSpread({}, scaleQueryParams), queryParams), {}, {
|
|
21
|
+
preferredRepresentation: 'IMAGE'
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
return serviceUtils.requestService(serviceConfig, requestOptions);
|
|
25
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { calculateScale } from './calculateScale';
|
|
2
|
+
import { getPixelRatio } from './getPixelRatio';
|
|
3
|
+
export var getAltRepresentation = function getAltRepresentation(reps) {
|
|
4
|
+
// Invalid reps handled outside function - logic may change depending what the service returns
|
|
5
|
+
return reps[calculateScale(getPixelRatio).altScale];
|
|
6
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isEmojiDescriptionWithVariations } from '../util/is-emoji-description-with-variations';
|
|
2
|
+
export var getEmojiVariation = function getEmojiVariation(emoji, options) {
|
|
3
|
+
if (isEmojiDescriptionWithVariations(emoji) && options) {
|
|
4
|
+
var skinTone = options.skinTone;
|
|
5
|
+
if (skinTone && emoji.skinVariations && emoji.skinVariations.length) {
|
|
6
|
+
var skinToneEmoji = emoji.skinVariations[skinTone - 1]; // skinTone start at 1
|
|
7
|
+
if (skinToneEmoji) {
|
|
8
|
+
return skinToneEmoji;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return emoji;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
export var AlphabeticalShortnameComparator = /*#__PURE__*/function () {
|
|
4
|
+
function AlphabeticalShortnameComparator() {
|
|
5
|
+
_classCallCheck(this, AlphabeticalShortnameComparator);
|
|
6
|
+
}
|
|
7
|
+
return _createClass(AlphabeticalShortnameComparator, [{
|
|
8
|
+
key: "compare",
|
|
9
|
+
value: function compare(e1, e2) {
|
|
10
|
+
return e1.shortName.localeCompare(e2.shortName);
|
|
11
|
+
}
|
|
12
|
+
}], [{
|
|
13
|
+
key: "Instance",
|
|
14
|
+
get: function get() {
|
|
15
|
+
return this.INSTANCE || (this.INSTANCE = new this());
|
|
16
|
+
}
|
|
17
|
+
}]);
|
|
18
|
+
}();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
/**
|
|
4
|
+
* Orders two emoji such that if one of them has an ascii representation that exactly matches the query then it will
|
|
5
|
+
* be ordered first.
|
|
6
|
+
*/
|
|
7
|
+
export var AsciiMatchComparator = /*#__PURE__*/function () {
|
|
8
|
+
function AsciiMatchComparator(query) {
|
|
9
|
+
_classCallCheck(this, AsciiMatchComparator);
|
|
10
|
+
this.query = query;
|
|
11
|
+
}
|
|
12
|
+
return _createClass(AsciiMatchComparator, [{
|
|
13
|
+
key: "compare",
|
|
14
|
+
value: function compare(e1, e2) {
|
|
15
|
+
var e1HasAscii = e1.ascii && e1.ascii.indexOf(this.query) !== -1;
|
|
16
|
+
var e2HasAscii = e2.ascii && e2.ascii.indexOf(this.query) !== -1;
|
|
17
|
+
if (e1HasAscii && !e2HasAscii) {
|
|
18
|
+
return -1;
|
|
19
|
+
} else if (!e1HasAscii && e2HasAscii) {
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
}]);
|
|
25
|
+
}();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
/**
|
|
4
|
+
* A combinator comparator that applies an ordered chained of sub-comparators. The first comparator that
|
|
5
|
+
* returns a non-zero value stops the chain and causes that value to be returned. If a comparator returns a
|
|
6
|
+
* zero then the next one in the chain is tried.
|
|
7
|
+
*
|
|
8
|
+
* If no comparators in the chain return a non-zero value then zero will be returned.
|
|
9
|
+
*/
|
|
10
|
+
export var ChainedEmojiComparator = /*#__PURE__*/function () {
|
|
11
|
+
function ChainedEmojiComparator() {
|
|
12
|
+
_classCallCheck(this, ChainedEmojiComparator);
|
|
13
|
+
for (var _len = arguments.length, comparators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
+
comparators[_key] = arguments[_key];
|
|
15
|
+
}
|
|
16
|
+
this.chain = comparators;
|
|
17
|
+
}
|
|
18
|
+
return _createClass(ChainedEmojiComparator, [{
|
|
19
|
+
key: "compare",
|
|
20
|
+
value: function compare(e1, e2) {
|
|
21
|
+
for (var i = 0; i < this.chain.length; i++) {
|
|
22
|
+
var result = this.chain[i].compare(e1, e2);
|
|
23
|
+
if (result !== 0) {
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
}]);
|
|
30
|
+
}();
|
|
@@ -1,275 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _construct from "@babel/runtime/helpers/construct";
|
|
4
|
-
import { MAX_ORDINAL } from '../../util/constants';
|
|
5
|
-
import { isEmojiVariationDescription } from '../../util/type-helpers';
|
|
6
|
-
/**
|
|
7
|
-
* Create the default sort comparator to be used for the user queries against emoji
|
|
8
|
-
*
|
|
9
|
-
* @param query the query used in the search to be sorted. Any colons will be stripped from the query and it will be
|
|
10
|
-
* converted to lowercase.
|
|
11
|
-
* @param orderedIds the id of emoji ordered by how frequently they are used
|
|
12
|
-
*/
|
|
13
|
-
export function createSearchEmojiComparator(query, orderedIds) {
|
|
14
|
-
var textQuery = query ? query.replace(/:/g, '').toLowerCase().trim() : undefined;
|
|
15
|
-
var comparators = [];
|
|
16
|
-
if (query) {
|
|
17
|
-
comparators.push(new AsciiMatchComparator(query));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Add the comparators to the 'chain'. The order of adding each comparator is important to the sort that is applied by the
|
|
21
|
-
// ChainedEmojiComparator. (Which is why you may see the same 'if' a few times.)
|
|
22
|
-
|
|
23
|
-
if (textQuery) {
|
|
24
|
-
comparators.push(new ExactShortNameMatchComparator(textQuery));
|
|
25
|
-
}
|
|
26
|
-
if (orderedIds && orderedIds.length) {
|
|
27
|
-
comparators.push(new UsageFrequencyComparator(orderedIds));
|
|
28
|
-
}
|
|
29
|
-
if (textQuery) {
|
|
30
|
-
comparators.push(new QueryStringPositionMatchComparator(textQuery, 'shortName'), new QueryStringPositionMatchComparator(textQuery, 'name'));
|
|
31
|
-
}
|
|
32
|
-
comparators.push(OrderComparator.Instance, AlphabeticalShortnameComparator.Instance);
|
|
33
|
-
var comparator = _construct(ChainedEmojiComparator, comparators);
|
|
34
|
-
comparator.compare = comparator.compare.bind(comparator);
|
|
35
|
-
return comparator;
|
|
36
|
-
}
|
|
37
|
-
export function createUsageOnlyEmojiComparator(orderedIds) {
|
|
38
|
-
var comparator = new ChainedEmojiComparator(new UsageFrequencyComparator(orderedIds), new EmojiTypeComparator(), OrderComparator.Instance);
|
|
39
|
-
comparator.compare = comparator.compare.bind(comparator);
|
|
40
|
-
return comparator;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Returns a number representing the result of comparing e1 and e2.
|
|
45
|
-
* Compatible with Array.sort, which is to say -
|
|
46
|
-
* - less than 0 if e1 should come first
|
|
47
|
-
* - 0 if they are equal; e1 and e2 will be unchanged in position relative to each other
|
|
48
|
-
* - greater than 0 if e2 should come first.
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* A combinator comparator that applies an ordered chained of sub-comparators. The first comparator that
|
|
53
|
-
* returns a non-zero value stops the chain and causes that value to be returned. If a comparator returns a
|
|
54
|
-
* zero then the next one in the chain is tried.
|
|
55
|
-
*
|
|
56
|
-
* If no comparators in the chain return a non-zero value then zero will be returned.
|
|
57
|
-
*/
|
|
58
|
-
export var ChainedEmojiComparator = /*#__PURE__*/function () {
|
|
59
|
-
function ChainedEmojiComparator() {
|
|
60
|
-
_classCallCheck(this, ChainedEmojiComparator);
|
|
61
|
-
for (var _len = arguments.length, comparators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
62
|
-
comparators[_key] = arguments[_key];
|
|
63
|
-
}
|
|
64
|
-
this.chain = comparators;
|
|
65
|
-
}
|
|
66
|
-
return _createClass(ChainedEmojiComparator, [{
|
|
67
|
-
key: "compare",
|
|
68
|
-
value: function compare(e1, e2) {
|
|
69
|
-
for (var i = 0; i < this.chain.length; i++) {
|
|
70
|
-
var result = this.chain[i].compare(e1, e2);
|
|
71
|
-
if (result !== 0) {
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return 0;
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
}();
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Orders two emoji such that if one of them has an ascii representation that exactly matches the query then it will
|
|
82
|
-
* be ordered first.
|
|
83
|
-
*/
|
|
84
|
-
export var AsciiMatchComparator = /*#__PURE__*/function () {
|
|
85
|
-
function AsciiMatchComparator(query) {
|
|
86
|
-
_classCallCheck(this, AsciiMatchComparator);
|
|
87
|
-
this.query = query;
|
|
88
|
-
}
|
|
89
|
-
return _createClass(AsciiMatchComparator, [{
|
|
90
|
-
key: "compare",
|
|
91
|
-
value: function compare(e1, e2) {
|
|
92
|
-
var e1HasAscii = e1.ascii && e1.ascii.indexOf(this.query) !== -1;
|
|
93
|
-
var e2HasAscii = e2.ascii && e2.ascii.indexOf(this.query) !== -1;
|
|
94
|
-
if (e1HasAscii && !e2HasAscii) {
|
|
95
|
-
return -1;
|
|
96
|
-
} else if (!e1HasAscii && e2HasAscii) {
|
|
97
|
-
return 1;
|
|
98
|
-
}
|
|
99
|
-
return 0;
|
|
100
|
-
}
|
|
101
|
-
}]);
|
|
102
|
-
}();
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Orders two emoji such that the one who's shortname matches the query exactly comes first. If there are matching
|
|
106
|
-
* shortnames then the type of emoji is taken into account with SITE emoji coming first.
|
|
107
|
-
*/
|
|
108
|
-
export var ExactShortNameMatchComparator = /*#__PURE__*/function () {
|
|
109
|
-
function ExactShortNameMatchComparator(query) {
|
|
110
|
-
_classCallCheck(this, ExactShortNameMatchComparator);
|
|
111
|
-
this.colonQuery = ":".concat(query, ":");
|
|
112
|
-
this.typeComparator = new EmojiTypeComparator(true);
|
|
113
|
-
}
|
|
114
|
-
return _createClass(ExactShortNameMatchComparator, [{
|
|
115
|
-
key: "compare",
|
|
116
|
-
value: function compare(e1, e2) {
|
|
117
|
-
if (e1.shortName === this.colonQuery && e2.shortName === this.colonQuery) {
|
|
118
|
-
return this.typeComparator.compare(e1, e2);
|
|
119
|
-
} else if (e1.shortName === this.colonQuery) {
|
|
120
|
-
return -1;
|
|
121
|
-
} else if (e2.shortName === this.colonQuery) {
|
|
122
|
-
return 1;
|
|
123
|
-
}
|
|
124
|
-
return 0;
|
|
125
|
-
}
|
|
126
|
-
}]);
|
|
127
|
-
}();
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Orders two emoji based on their type, with the types being STANDARD, ATLASSIAN and SITE (in that order).
|
|
131
|
-
* If the comparator is configured to 'reverse' then the order will be SITE, ATLASSIAN, STANDARD.
|
|
132
|
-
*
|
|
133
|
-
* Regardless of the reverse setting, an unknown type will always come last.
|
|
134
|
-
*/
|
|
135
|
-
export var EmojiTypeComparator = /*#__PURE__*/function () {
|
|
136
|
-
function EmojiTypeComparator(reverse) {
|
|
137
|
-
_classCallCheck(this, EmojiTypeComparator);
|
|
138
|
-
if (reverse) {
|
|
139
|
-
this.typeToNumber = new Map([['SITE', 0], ['ATLASSIAN', 1], ['STANDARD', 2]]);
|
|
140
|
-
} else {
|
|
141
|
-
this.typeToNumber = new Map([['STANDARD', 0], ['ATLASSIAN', 1], ['SITE', 2]]);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return _createClass(EmojiTypeComparator, [{
|
|
145
|
-
key: "compare",
|
|
146
|
-
value: function compare(e1, e2) {
|
|
147
|
-
return this.emojiTypeToOrdinal(e1) - this.emojiTypeToOrdinal(e2);
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "emojiTypeToOrdinal",
|
|
151
|
-
value: function emojiTypeToOrdinal(emoji) {
|
|
152
|
-
var ordinal = this.typeToNumber.get(emoji.type);
|
|
153
|
-
if (ordinal === undefined) {
|
|
154
|
-
ordinal = 10;
|
|
155
|
-
}
|
|
156
|
-
return ordinal;
|
|
157
|
-
}
|
|
158
|
-
}]);
|
|
159
|
-
}();
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Order two emoji such as the one which is more frequently used comes first. If neither have any usage
|
|
163
|
-
* information then leave their order unchanged.
|
|
164
|
-
*/
|
|
165
|
-
export var UsageFrequencyComparator = /*#__PURE__*/function () {
|
|
166
|
-
// A Map of emoji base Id to their order in a least of most frequently used
|
|
167
|
-
|
|
168
|
-
function UsageFrequencyComparator(orderedIds) {
|
|
169
|
-
var _this = this;
|
|
170
|
-
_classCallCheck(this, UsageFrequencyComparator);
|
|
171
|
-
this.positionLookup = new Map();
|
|
172
|
-
// Make ordering start from 1 to avoid having zero in the map (which is falsey)
|
|
173
|
-
orderedIds.map(function (id, index) {
|
|
174
|
-
return _this.positionLookup.set(id, index + 1);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
return _createClass(UsageFrequencyComparator, [{
|
|
178
|
-
key: "compare",
|
|
179
|
-
value: function compare(e1, e2) {
|
|
180
|
-
if (!e1.id || !e2.id) {
|
|
181
|
-
return 0; // this shouldn't occur. Leave position unchanged if there is any missing id.
|
|
182
|
-
}
|
|
183
|
-
var i1 = this.getPositionInOrder(e1);
|
|
184
|
-
var i2 = this.getPositionInOrder(e2);
|
|
185
|
-
return i1 - i2;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Get the ordinal representing the position of this emoji.
|
|
190
|
-
*
|
|
191
|
-
* @param id the id of the emoji
|
|
192
|
-
*/
|
|
193
|
-
}, {
|
|
194
|
-
key: "getPositionInOrder",
|
|
195
|
-
value: function getPositionInOrder(emoji) {
|
|
196
|
-
var id = emoji.id ? emoji.id : '0';
|
|
197
|
-
if (isEmojiVariationDescription(emoji)) {
|
|
198
|
-
id = emoji.baseId;
|
|
199
|
-
}
|
|
200
|
-
var position = this.positionLookup.get(id);
|
|
201
|
-
if (position) {
|
|
202
|
-
return position;
|
|
203
|
-
} else {
|
|
204
|
-
return MAX_ORDINAL;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}]);
|
|
208
|
-
}();
|
|
209
|
-
/**
|
|
210
|
-
* A comparator that will sort higher an emoji which matches the query string earliest in the indicated
|
|
211
|
-
* property.
|
|
212
|
-
*/
|
|
213
|
-
export var QueryStringPositionMatchComparator = /*#__PURE__*/function () {
|
|
214
|
-
/**
|
|
215
|
-
* @param query the query to match
|
|
216
|
-
* @param propertyToCompare the property of EmojiDescription to check for query within
|
|
217
|
-
*/
|
|
218
|
-
function QueryStringPositionMatchComparator(query, propertyToCompare) {
|
|
219
|
-
_classCallCheck(this, QueryStringPositionMatchComparator);
|
|
220
|
-
this.query = query;
|
|
221
|
-
if (!propertyToCompare) {
|
|
222
|
-
throw new Error('propertyToCompare is required');
|
|
223
|
-
}
|
|
224
|
-
this.propertyName = propertyToCompare;
|
|
225
|
-
}
|
|
226
|
-
return _createClass(QueryStringPositionMatchComparator, [{
|
|
227
|
-
key: "getScore",
|
|
228
|
-
value: function getScore(emoji) {
|
|
229
|
-
// It is fine to do override the null check here because we are checking
|
|
230
|
-
// it on the constructor.
|
|
231
|
-
var propertyValue = emoji[this.propertyName];
|
|
232
|
-
var score = propertyValue ? propertyValue.indexOf(this.query) : MAX_ORDINAL;
|
|
233
|
-
return score === -1 ? MAX_ORDINAL : score;
|
|
234
|
-
}
|
|
235
|
-
}, {
|
|
236
|
-
key: "compare",
|
|
237
|
-
value: function compare(e1, e2) {
|
|
238
|
-
return this.getScore(e1) - this.getScore(e2);
|
|
239
|
-
}
|
|
240
|
-
}]);
|
|
241
|
-
}();
|
|
242
|
-
export var OrderComparator = /*#__PURE__*/function () {
|
|
243
|
-
function OrderComparator() {
|
|
244
|
-
_classCallCheck(this, OrderComparator);
|
|
245
|
-
}
|
|
246
|
-
return _createClass(OrderComparator, [{
|
|
247
|
-
key: "compare",
|
|
248
|
-
value: function compare(e1, e2) {
|
|
249
|
-
var o1 = e1.order ? e1.order : MAX_ORDINAL;
|
|
250
|
-
var o2 = e2.order ? e2.order : MAX_ORDINAL;
|
|
251
|
-
return o1 - o2;
|
|
252
|
-
}
|
|
253
|
-
}], [{
|
|
254
|
-
key: "Instance",
|
|
255
|
-
get: function get() {
|
|
256
|
-
return this.INSTANCE || (this.INSTANCE = new this());
|
|
257
|
-
}
|
|
258
|
-
}]);
|
|
259
|
-
}();
|
|
260
|
-
export var AlphabeticalShortnameComparator = /*#__PURE__*/function () {
|
|
261
|
-
function AlphabeticalShortnameComparator() {
|
|
262
|
-
_classCallCheck(this, AlphabeticalShortnameComparator);
|
|
263
|
-
}
|
|
264
|
-
return _createClass(AlphabeticalShortnameComparator, [{
|
|
265
|
-
key: "compare",
|
|
266
|
-
value: function compare(e1, e2) {
|
|
267
|
-
return e1.shortName.localeCompare(e2.shortName);
|
|
268
|
-
}
|
|
269
|
-
}], [{
|
|
270
|
-
key: "Instance",
|
|
271
|
-
get: function get() {
|
|
272
|
-
return this.INSTANCE || (this.INSTANCE = new this());
|
|
273
|
-
}
|
|
274
|
-
}]);
|
|
275
|
-
}();
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
/**
|
|
4
|
+
* Orders two emoji based on their type, with the types being STANDARD, ATLASSIAN and SITE (in that order).
|
|
5
|
+
* If the comparator is configured to 'reverse' then the order will be SITE, ATLASSIAN, STANDARD.
|
|
6
|
+
*
|
|
7
|
+
* Regardless of the reverse setting, an unknown type will always come last.
|
|
8
|
+
*/
|
|
9
|
+
export var EmojiTypeComparator = /*#__PURE__*/function () {
|
|
10
|
+
function EmojiTypeComparator(reverse) {
|
|
11
|
+
_classCallCheck(this, EmojiTypeComparator);
|
|
12
|
+
if (reverse) {
|
|
13
|
+
this.typeToNumber = new Map([['SITE', 0], ['ATLASSIAN', 1], ['STANDARD', 2]]);
|
|
14
|
+
} else {
|
|
15
|
+
this.typeToNumber = new Map([['STANDARD', 0], ['ATLASSIAN', 1], ['SITE', 2]]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return _createClass(EmojiTypeComparator, [{
|
|
19
|
+
key: "compare",
|
|
20
|
+
value: function compare(e1, e2) {
|
|
21
|
+
return this.emojiTypeToOrdinal(e1) - this.emojiTypeToOrdinal(e2);
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "emojiTypeToOrdinal",
|
|
25
|
+
value: function emojiTypeToOrdinal(emoji) {
|
|
26
|
+
var ordinal = this.typeToNumber.get(emoji.type);
|
|
27
|
+
if (ordinal === undefined) {
|
|
28
|
+
ordinal = 10;
|
|
29
|
+
}
|
|
30
|
+
return ordinal;
|
|
31
|
+
}
|
|
32
|
+
}]);
|
|
33
|
+
}();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { EmojiTypeComparator } from './EmojiTypeComparator';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Orders two emoji such that the one who's shortname matches the query exactly comes first. If there are matching
|
|
7
|
+
* shortnames then the type of emoji is taken into account with SITE emoji coming first.
|
|
8
|
+
*/
|
|
9
|
+
export var ExactShortNameMatchComparator = /*#__PURE__*/function () {
|
|
10
|
+
function ExactShortNameMatchComparator(query) {
|
|
11
|
+
_classCallCheck(this, ExactShortNameMatchComparator);
|
|
12
|
+
this.colonQuery = ":".concat(query, ":");
|
|
13
|
+
this.typeComparator = new EmojiTypeComparator(true);
|
|
14
|
+
}
|
|
15
|
+
return _createClass(ExactShortNameMatchComparator, [{
|
|
16
|
+
key: "compare",
|
|
17
|
+
value: function compare(e1, e2) {
|
|
18
|
+
if (e1.shortName === this.colonQuery && e2.shortName === this.colonQuery) {
|
|
19
|
+
return this.typeComparator.compare(e1, e2);
|
|
20
|
+
} else if (e1.shortName === this.colonQuery) {
|
|
21
|
+
return -1;
|
|
22
|
+
} else if (e2.shortName === this.colonQuery) {
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
}]);
|
|
28
|
+
}();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
export var Gateway = /*#__PURE__*/function () {
|
|
4
|
+
function Gateway(maximumPermitted) {
|
|
5
|
+
_classCallCheck(this, Gateway);
|
|
6
|
+
if (maximumPermitted < 1) {
|
|
7
|
+
throw new RangeError('The maximumPermitted parameter must be 1 or more.');
|
|
8
|
+
}
|
|
9
|
+
this.maximumPermitted = maximumPermitted;
|
|
10
|
+
this.count = 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Run the supplied function if the count of already submitted work allows it. Drop the work
|
|
15
|
+
* if it's not allowed to run.
|
|
16
|
+
*
|
|
17
|
+
* Will return true if the function has been submitted or false if it was not submitted.
|
|
18
|
+
*/
|
|
19
|
+
return _createClass(Gateway, [{
|
|
20
|
+
key: "submit",
|
|
21
|
+
value: function submit(f) {
|
|
22
|
+
var _this = this;
|
|
23
|
+
if (this.count >= this.maximumPermitted) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
this.count++;
|
|
27
|
+
var wrappedFunc = function wrappedFunc() {
|
|
28
|
+
try {
|
|
29
|
+
f();
|
|
30
|
+
} finally {
|
|
31
|
+
_this.completed();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
if (typeof window !== 'undefined') {
|
|
35
|
+
window.setTimeout(wrappedFunc);
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
key: "completed",
|
|
41
|
+
value: function completed() {
|
|
42
|
+
this.count--;
|
|
43
|
+
}
|
|
44
|
+
}]);
|
|
45
|
+
}();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { MAX_ORDINAL } from '../../util/constants';
|
|
4
|
+
export var OrderComparator = /*#__PURE__*/function () {
|
|
5
|
+
function OrderComparator() {
|
|
6
|
+
_classCallCheck(this, OrderComparator);
|
|
7
|
+
}
|
|
8
|
+
return _createClass(OrderComparator, [{
|
|
9
|
+
key: "compare",
|
|
10
|
+
value: function compare(e1, e2) {
|
|
11
|
+
var o1 = e1.order ? e1.order : MAX_ORDINAL;
|
|
12
|
+
var o2 = e2.order ? e2.order : MAX_ORDINAL;
|
|
13
|
+
return o1 - o2;
|
|
14
|
+
}
|
|
15
|
+
}], [{
|
|
16
|
+
key: "Instance",
|
|
17
|
+
get: function get() {
|
|
18
|
+
return this.INSTANCE || (this.INSTANCE = new this());
|
|
19
|
+
}
|
|
20
|
+
}]);
|
|
21
|
+
}();
|