@atlaskit/emoji 71.17.1 → 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 +46 -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 -373
- 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 -352
- 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 -358
- 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 +1 -1
- 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
|
@@ -1,121 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
3
|
+
import { isPromise } from '../../util/is-promise';
|
|
4
4
|
import debug from '../../util/logger';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { BrowserCacheStrategy } from './BrowserCacheStrategy';
|
|
6
|
+
import { getRequiredRepresentation } from './getRequiredRepresentation';
|
|
7
|
+
import MediaImageLoader from './MediaImageLoader';
|
|
8
|
+
import { MemoryCacheStrategy } from './MemoryCacheStrategy';
|
|
9
|
+
export const maxImageCached = 1000;
|
|
10
10
|
|
|
11
|
-
return isIE || isEdge;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* For browsers that support caching for resources
|
|
15
|
-
* regardless of originally supplied headers (basically everything but Firefox).
|
|
16
|
-
*/
|
|
17
|
-
export class BrowserCacheStrategy {
|
|
18
|
-
constructor(mediaImageLoader) {
|
|
19
|
-
_defineProperty(this, "cachedImageUrls", new Set());
|
|
20
|
-
debug('BrowserCacheStrategy');
|
|
21
|
-
this.mediaImageLoader = mediaImageLoader;
|
|
22
|
-
}
|
|
23
|
-
loadEmoji(emoji, useAlt) {
|
|
24
|
-
const representation = getRequiredRepresentation(emoji, useAlt);
|
|
25
|
-
if (!isMediaRepresentation(representation)) {
|
|
26
|
-
return emoji;
|
|
27
|
-
}
|
|
28
|
-
const {
|
|
29
|
-
mediaPath
|
|
30
|
-
} = representation;
|
|
31
|
-
if (this.cachedImageUrls.has(mediaPath)) {
|
|
32
|
-
// Already cached
|
|
33
|
-
return emoji;
|
|
34
|
-
}
|
|
35
|
-
return this.mediaImageLoader.loadMediaImage(mediaPath).then(() => {
|
|
36
|
-
// Media is loaded, can use original URL now, so just return original emoji
|
|
37
|
-
this.cachedImageUrls.add(mediaPath);
|
|
38
|
-
return emoji;
|
|
39
|
-
}).catch(() => {
|
|
40
|
-
return undefined;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
optimisticRendering() {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
static supported(mediaPath, mediaImageLoader) {
|
|
47
|
-
// IE/Edge uses memory cache strategy else images can fail to load
|
|
48
|
-
// from a clean cache/if they are downloaded from the service
|
|
49
|
-
// TODO: fix as a part of FS-1592
|
|
50
|
-
if (isUnsupportedBrowser()) {
|
|
51
|
-
return Promise.resolve(false);
|
|
52
|
-
}
|
|
53
|
-
return mediaImageLoader.loadMediaImage(mediaPath).then(() =>
|
|
54
|
-
// Image should be cached in browser, if supported it should be accessible from the cache by an <img/>
|
|
55
|
-
// Try to load without via image to confirm this support (this fails in Firefox)
|
|
56
|
-
new Promise(resolve => {
|
|
57
|
-
const img = new Image();
|
|
58
|
-
img.addEventListener('load', () => {
|
|
59
|
-
resolve(true);
|
|
60
|
-
});
|
|
61
|
-
img.addEventListener('error', () => {
|
|
62
|
-
resolve(false);
|
|
63
|
-
});
|
|
64
|
-
img.src = mediaPath;
|
|
65
|
-
})).catch(() => false);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const maxImageCached = 1000;
|
|
69
11
|
// Don't cache images large than this - dataUrl size in characters
|
|
70
|
-
const maxImageSize = 10000;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* For browsers that do no cache images without equivalent headers (e.g. Firefox).
|
|
74
|
-
*
|
|
75
|
-
* Images are cached in memory in a LRU cache. Images considered too large,
|
|
76
|
-
* are not cached, but retrieved each time.
|
|
77
|
-
*
|
|
78
|
-
* Images are still cached by the browser, but loading in asynchronous with
|
|
79
|
-
* small delay noticable to the end user.
|
|
80
|
-
*/
|
|
81
|
-
export class MemoryCacheStrategy {
|
|
82
|
-
constructor(mediaImageLoader) {
|
|
83
|
-
debug('MemoryCacheStrategy');
|
|
84
|
-
this.mediaImageLoader = mediaImageLoader;
|
|
85
|
-
this.dataURLCache = new LRUMap(maxImageCached);
|
|
86
|
-
}
|
|
87
|
-
loadEmoji(emoji, useAlt) {
|
|
88
|
-
const representation = getRequiredRepresentation(emoji, useAlt);
|
|
89
|
-
if (!isMediaRepresentation(representation)) {
|
|
90
|
-
return emoji;
|
|
91
|
-
}
|
|
92
|
-
const {
|
|
93
|
-
mediaPath
|
|
94
|
-
} = representation;
|
|
95
|
-
const dataURL = this.dataURLCache.get(mediaPath);
|
|
96
|
-
if (dataURL) {
|
|
97
|
-
// Already cached
|
|
98
|
-
return convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Not cached, load
|
|
102
|
-
return this.mediaImageLoader.loadMediaImage(mediaPath).then(dataURL => {
|
|
103
|
-
const loadedEmoji = convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
104
|
-
if (dataURL.length <= maxImageSize) {
|
|
105
|
-
// Only cache if not large than max size
|
|
106
|
-
this.dataURLCache.set(mediaPath, dataURL);
|
|
107
|
-
} else {
|
|
108
|
-
debug('No caching as image is too large', dataURL.length, dataURL.slice(0, 15), emoji.shortName);
|
|
109
|
-
}
|
|
110
|
-
return loadedEmoji;
|
|
111
|
-
}).catch(() => {
|
|
112
|
-
return undefined;
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
optimisticRendering() {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
12
|
+
export const maxImageSize = 10000;
|
|
119
13
|
|
|
120
14
|
/**
|
|
121
15
|
* Provides a cache for Media Emoji.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LRUMap } from 'lru_map';
|
|
2
|
+
import { convertMediaToImageEmoji } from '../../util/convert-media-to-image-emoji';
|
|
3
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
4
|
+
import debug from '../../util/logger';
|
|
5
|
+
import { maxImageCached, maxImageSize } from './MediaEmojiCache';
|
|
6
|
+
import { getRequiredRepresentation } from './getRequiredRepresentation';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* For browsers that do no cache images without equivalent headers (e.g. Firefox).
|
|
10
|
+
*
|
|
11
|
+
* Images are cached in memory in a LRU cache. Images considered too large,
|
|
12
|
+
* are not cached, but retrieved each time.
|
|
13
|
+
*
|
|
14
|
+
* Images are still cached by the browser, but loading in asynchronous with
|
|
15
|
+
* small delay noticable to the end user.
|
|
16
|
+
*/
|
|
17
|
+
export class MemoryCacheStrategy {
|
|
18
|
+
constructor(mediaImageLoader) {
|
|
19
|
+
debug('MemoryCacheStrategy');
|
|
20
|
+
this.mediaImageLoader = mediaImageLoader;
|
|
21
|
+
this.dataURLCache = new LRUMap(maxImageCached);
|
|
22
|
+
}
|
|
23
|
+
loadEmoji(emoji, useAlt) {
|
|
24
|
+
const representation = getRequiredRepresentation(emoji, useAlt);
|
|
25
|
+
if (!isMediaRepresentation(representation)) {
|
|
26
|
+
return emoji;
|
|
27
|
+
}
|
|
28
|
+
const {
|
|
29
|
+
mediaPath
|
|
30
|
+
} = representation;
|
|
31
|
+
const dataURL = this.dataURLCache.get(mediaPath);
|
|
32
|
+
if (dataURL) {
|
|
33
|
+
// Already cached
|
|
34
|
+
return convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Not cached, load
|
|
38
|
+
return this.mediaImageLoader.loadMediaImage(mediaPath).then(dataURL => {
|
|
39
|
+
const loadedEmoji = convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
40
|
+
if (dataURL.length <= maxImageSize) {
|
|
41
|
+
// Only cache if not large than max size
|
|
42
|
+
this.dataURLCache.set(mediaPath, dataURL);
|
|
43
|
+
} else {
|
|
44
|
+
debug('No caching as image is too large', dataURL.length, dataURL.slice(0, 15), emoji.shortName);
|
|
45
|
+
}
|
|
46
|
+
return loadedEmoji;
|
|
47
|
+
}).catch(() => {
|
|
48
|
+
return undefined;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
optimisticRendering() {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
3
2
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
4
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
-
import {
|
|
4
|
+
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
5
|
+
import { buildEmojiDescriptionWithAltRepresentation } from '../../util/build-emoji-description-with-alt-representation';
|
|
6
|
+
import { convertImageToMediaRepresentation } from '../../util/convert-image-to-media-representation';
|
|
7
|
+
import { isLoadedMediaEmoji } from '../../util/is-loaded-media-emoji';
|
|
8
|
+
import { isMediaEmoji } from '../../util/is-media-emoji';
|
|
9
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
10
|
+
import debug from '../../util/logger';
|
|
11
|
+
import { denormaliseEmojiServiceResponse } from '../denormaliseEmojiServiceResponse';
|
|
12
|
+
import { emojiRequest } from '../emojiRequest';
|
|
13
|
+
import { getAltRepresentation } from '../getAltRepresentation';
|
|
6
14
|
import MediaEmojiCache from './MediaEmojiCache';
|
|
7
|
-
import { denormaliseEmojiServiceResponse, emojiRequest, getAltRepresentation } from '../EmojiUtils';
|
|
8
15
|
import TokenManager from './TokenManager';
|
|
9
|
-
import debug from '../../util/logger';
|
|
10
16
|
// Assume media is 95% of total upload time.
|
|
11
17
|
export const mediaProportionOfProgress = 95 / 100;
|
|
12
18
|
export default class SiteEmojiResource {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getRequiredRepresentation = (emoji, useAlt) => useAlt ? emoji.altRepresentation : emoji.representation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { getPixelRatio } from './getPixelRatio';
|
|
2
|
+
const getHeight = fitToHeight => getPixelRatio() > 1 ? fitToHeight * 2 : fitToHeight;
|
|
3
|
+
export const shouldUseAltRepresentation = (emoji, fitToHeight) => !!(fitToHeight && emoji.altRepresentation && emoji.representation && 'height' in emoji.representation && getHeight(fitToHeight) > emoji.representation.height);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the emojiProvider can support uploading at a feature level.
|
|
3
|
+
*
|
|
4
|
+
* Follow this up with an isUploadSupported() check to see if the provider is actually
|
|
5
|
+
* configured to support uploads.
|
|
6
|
+
* https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
|
|
7
|
+
*/
|
|
8
|
+
export const supportsUploadFeature = emojiProvider => {
|
|
9
|
+
const emojiUploadProvider = emojiProvider;
|
|
10
|
+
return !!emojiUploadProvider.isUploadSupported && !!emojiUploadProvider.uploadCustomEmoji && !!emojiUploadProvider.prepareForUpload;
|
|
11
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* AddOwnEmoji.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
+
import "./AddOwnEmoji.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment, useCallback } from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import AkButton from '@atlaskit/button/standard-button';
|
|
8
|
+
import AddIcon from '@atlaskit/icon/core/add';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
|
+
import { messages } from '../i18n';
|
|
12
|
+
import { uploadEmojiTestId } from './EmojiActions';
|
|
13
|
+
import { isRefreshEmojiPickerEnabled } from './isRefreshEmojiPickerEnabled';
|
|
14
|
+
import { emojiPickerAddEmoji } from './styles';
|
|
15
|
+
const styles = {
|
|
16
|
+
icon: "_18u0r5cr _2hwx1i6y"
|
|
17
|
+
};
|
|
18
|
+
const addCustomEmoji = null;
|
|
19
|
+
const addCustomEmojiButton = null;
|
|
20
|
+
export const AddOwnEmoji = props => {
|
|
21
|
+
const {
|
|
22
|
+
onOpenUpload,
|
|
23
|
+
uploadEnabled
|
|
24
|
+
} = props;
|
|
25
|
+
const handleOpenUpload = useCallback(event => {
|
|
26
|
+
if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
}
|
|
30
|
+
onOpenUpload();
|
|
31
|
+
}, [onOpenUpload]);
|
|
32
|
+
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
"data-testid": uploadEmojiTestId,
|
|
34
|
+
className: ax(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
35
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, label => /*#__PURE__*/React.createElement(AkButton, {
|
|
36
|
+
onClick: handleOpenUpload,
|
|
37
|
+
iconBefore: /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
xcss: styles.icon
|
|
39
|
+
}, /*#__PURE__*/React.createElement(AddIcon, {
|
|
40
|
+
color: "currentColor",
|
|
41
|
+
label: ""
|
|
42
|
+
})),
|
|
43
|
+
appearance: "subtle"
|
|
44
|
+
// TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
|
|
46
|
+
,
|
|
47
|
+
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
49
|
+
className: ax(["_p12f3sup", emojiPickerAddEmoji]),
|
|
50
|
+
tabIndex: 0,
|
|
51
|
+
id: "add-custom-emoji"
|
|
52
|
+
}, label))));
|
|
53
|
+
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { memo, useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { hasUfoMarked } from '../../util/analytics/hasUfoMarked';
|
|
4
|
+
import { sampledUfoRenderedEmoji } from '../../util/analytics/sampledUfoRenderedEmoji';
|
|
5
|
+
import { ufoExperiences } from '../../util/analytics/ufoExperiences';
|
|
6
|
+
import { useSampledUFOComponentExperience } from '../../util/analytics/useSampledUFOComponentExperience';
|
|
7
|
+
import { SAMPLING_RATE_EMOJI_RENDERED_EXP } from '../../util/constants';
|
|
8
|
+
import { isMediaEmoji } from '../../util/is-media-emoji';
|
|
9
|
+
import { CachingMediaEmoji } from './CachingMediaEmoji';
|
|
6
10
|
import Emoji from './Emoji';
|
|
7
|
-
import EmojiPlaceholder from './EmojiPlaceholder';
|
|
8
11
|
import EmojiFallback from './EmojiFallback';
|
|
9
12
|
import { UfoErrorBoundary } from './UfoErrorBoundary';
|
|
10
|
-
import { sampledUfoRenderedEmoji, ufoExperiences, useSampledUFOComponentExperience } from '../../util/analytics';
|
|
11
|
-
import { SAMPLING_RATE_EMOJI_RENDERED_EXP } from '../../util/constants';
|
|
12
|
-
import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
|
|
13
|
-
import { useEmoji } from '../../hooks/useEmoji';
|
|
14
|
-
import { useCallback } from 'react';
|
|
15
|
-
import { extractErrorInfo } from '../../util/analytics/analytics';
|
|
16
13
|
/**
|
|
17
14
|
* Renders an emoji from a cached image, if required.
|
|
18
15
|
*/
|
|
@@ -69,79 +66,5 @@ const StandardEmoji = props => {
|
|
|
69
66
|
onLoadError: handleLoadError
|
|
70
67
|
}, restProps));
|
|
71
68
|
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Rendering a media emoji image from a cache for media emoji, with different
|
|
75
|
-
* rendering paths depending on caching strategy.
|
|
76
|
-
*/
|
|
77
|
-
export const CachingMediaEmoji = props => {
|
|
78
|
-
const {
|
|
79
|
-
emoji,
|
|
80
|
-
placeholderSize,
|
|
81
|
-
showTooltip,
|
|
82
|
-
fitToHeight,
|
|
83
|
-
children,
|
|
84
|
-
...restProps
|
|
85
|
-
} = props;
|
|
86
|
-
const {
|
|
87
|
-
shortName,
|
|
88
|
-
representation
|
|
89
|
-
} = emoji;
|
|
90
|
-
const [cachedEmoji, setCachedEmoji] = useState();
|
|
91
|
-
const [inValidImage, setInvalidImage] = useState(false);
|
|
92
|
-
const {
|
|
93
|
-
emojiProvider
|
|
94
|
-
} = useEmoji();
|
|
95
|
-
const loadEmoji = useCallback(emojiProvider => {
|
|
96
|
-
debug('Loading image via media cache', emoji.shortName);
|
|
97
|
-
sampledUfoRenderedEmoji(emoji).mark(UfoEmojiTimings.MEDIA_START);
|
|
98
|
-
emojiProvider.getMediaEmojiDescriptionURLWithInlineToken(emoji).then(cachedEmoji => {
|
|
99
|
-
setCachedEmoji(cachedEmoji);
|
|
100
|
-
setInvalidImage(false);
|
|
101
|
-
sampledUfoRenderedEmoji(emoji).mark(UfoEmojiTimings.MEDIA_END);
|
|
102
|
-
}).catch(error => {
|
|
103
|
-
setCachedEmoji(undefined);
|
|
104
|
-
setInvalidImage(true);
|
|
105
|
-
sampledUfoRenderedEmoji(emoji).failure({
|
|
106
|
-
metadata: {
|
|
107
|
-
error: extractErrorInfo(error),
|
|
108
|
-
reason: 'failed to load media emoji',
|
|
109
|
-
source: 'CachingMediaEmoji',
|
|
110
|
-
emojiId: emoji.id
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}, [emoji]);
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
if (emojiProvider) {
|
|
117
|
-
loadEmoji(emojiProvider);
|
|
118
|
-
}
|
|
119
|
-
}, [emojiProvider, loadEmoji]);
|
|
120
|
-
const handleLoadError = _emojiId => {
|
|
121
|
-
sampledUfoRenderedEmoji(_emojiId).failure({
|
|
122
|
-
metadata: {
|
|
123
|
-
reason: 'load error',
|
|
124
|
-
source: 'CachingMediaEmoji',
|
|
125
|
-
emojiId: _emojiId.id
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
setInvalidImage(true);
|
|
129
|
-
};
|
|
130
|
-
if (cachedEmoji && !inValidImage) {
|
|
131
|
-
return /*#__PURE__*/React.createElement(Emoji, _extends({}, restProps, {
|
|
132
|
-
showTooltip: showTooltip,
|
|
133
|
-
fitToHeight: fitToHeight,
|
|
134
|
-
emoji: cachedEmoji,
|
|
135
|
-
onLoadError: handleLoadError
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
const imageRepresentation = representation && 'height' in representation ? representation : undefined;
|
|
139
|
-
return /*#__PURE__*/React.createElement(EmojiPlaceholder, {
|
|
140
|
-
size: fitToHeight || placeholderSize,
|
|
141
|
-
shortName: shortName,
|
|
142
|
-
showTooltip: showTooltip,
|
|
143
|
-
representation: imageRepresentation
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
69
|
const _default_1 = /*#__PURE__*/memo(CachingEmoji);
|
|
147
70
|
export default _default_1;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useEmoji } from '../../hooks/useEmoji';
|
|
5
|
+
import { UfoEmojiTimings } from '../../types';
|
|
6
|
+
import { extractErrorInfo } from '../../util/analytics/extractErrorInfo';
|
|
7
|
+
import { sampledUfoRenderedEmoji } from '../../util/analytics/sampledUfoRenderedEmoji';
|
|
8
|
+
import debug from '../../util/logger';
|
|
9
|
+
import Emoji from './Emoji';
|
|
10
|
+
import EmojiPlaceholder from './EmojiPlaceholder';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Rendering a media emoji image from a cache for media emoji, with different
|
|
14
|
+
* rendering paths depending on caching strategy.
|
|
15
|
+
*/
|
|
16
|
+
export const CachingMediaEmoji = props => {
|
|
17
|
+
const {
|
|
18
|
+
emoji,
|
|
19
|
+
placeholderSize,
|
|
20
|
+
showTooltip,
|
|
21
|
+
fitToHeight,
|
|
22
|
+
children,
|
|
23
|
+
...restProps
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
shortName,
|
|
27
|
+
representation
|
|
28
|
+
} = emoji;
|
|
29
|
+
const [cachedEmoji, setCachedEmoji] = useState();
|
|
30
|
+
const [inValidImage, setInvalidImage] = useState(false);
|
|
31
|
+
const {
|
|
32
|
+
emojiProvider
|
|
33
|
+
} = useEmoji();
|
|
34
|
+
const loadEmoji = useCallback(emojiProvider => {
|
|
35
|
+
debug('Loading image via media cache', emoji.shortName);
|
|
36
|
+
sampledUfoRenderedEmoji(emoji).mark(UfoEmojiTimings.MEDIA_START);
|
|
37
|
+
emojiProvider.getMediaEmojiDescriptionURLWithInlineToken(emoji).then(cachedEmoji => {
|
|
38
|
+
setCachedEmoji(cachedEmoji);
|
|
39
|
+
setInvalidImage(false);
|
|
40
|
+
sampledUfoRenderedEmoji(emoji).mark(UfoEmojiTimings.MEDIA_END);
|
|
41
|
+
}).catch(error => {
|
|
42
|
+
setCachedEmoji(undefined);
|
|
43
|
+
setInvalidImage(true);
|
|
44
|
+
sampledUfoRenderedEmoji(emoji).failure({
|
|
45
|
+
metadata: {
|
|
46
|
+
error: extractErrorInfo(error),
|
|
47
|
+
reason: 'failed to load media emoji',
|
|
48
|
+
source: 'CachingMediaEmoji',
|
|
49
|
+
emojiId: emoji.id
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}, [emoji]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (emojiProvider) {
|
|
56
|
+
loadEmoji(emojiProvider);
|
|
57
|
+
}
|
|
58
|
+
}, [emojiProvider, loadEmoji]);
|
|
59
|
+
const handleLoadError = _emojiId => {
|
|
60
|
+
sampledUfoRenderedEmoji(_emojiId).failure({
|
|
61
|
+
metadata: {
|
|
62
|
+
reason: 'load error',
|
|
63
|
+
source: 'CachingMediaEmoji',
|
|
64
|
+
emojiId: _emojiId.id
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
setInvalidImage(true);
|
|
68
|
+
};
|
|
69
|
+
if (cachedEmoji && !inValidImage) {
|
|
70
|
+
return /*#__PURE__*/React.createElement(Emoji, _extends({}, restProps, {
|
|
71
|
+
showTooltip: showTooltip,
|
|
72
|
+
fitToHeight: fitToHeight,
|
|
73
|
+
emoji: cachedEmoji,
|
|
74
|
+
onLoadError: handleLoadError
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
const imageRepresentation = representation && 'height' in representation ? representation : undefined;
|
|
78
|
+
return /*#__PURE__*/React.createElement(EmojiPlaceholder, {
|
|
79
|
+
size: fitToHeight || placeholderSize,
|
|
80
|
+
shortName: shortName,
|
|
81
|
+
showTooltip: showTooltip,
|
|
82
|
+
representation: imageRepresentation
|
|
83
|
+
});
|
|
84
|
+
};
|
|
@@ -11,7 +11,9 @@ import { RovoIcon } from '@atlaskit/logo';
|
|
|
11
11
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
12
12
|
import { generateEmojiImage } from '../../api/ai/generateEmojiImage';
|
|
13
13
|
import { slugifyPrompt } from '../../util/ai-emoji';
|
|
14
|
-
import {
|
|
14
|
+
import { aiGenerationCompletedEvent } from '../../util/analytics/aiGenerationCompletedEvent';
|
|
15
|
+
import { aiGenerationFailedEvent } from '../../util/analytics/aiGenerationFailedEvent';
|
|
16
|
+
import { aiGenerationStartedEvent } from '../../util/analytics/aiGenerationStartedEvent';
|
|
15
17
|
import { messages } from '../i18n';
|
|
16
18
|
import EmojiErrorMessage from './EmojiErrorMessage';
|
|
17
19
|
export const createEmojiWithRovoTestId = 'create-emoji-with-rovo';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { backspace } from '../../util/keymaps';
|
|
4
4
|
import { messages } from '../i18n';
|
|
5
5
|
import { ToolTipContentWithKeymap } from './ToolTipContentWithKeymap';
|
|
6
|
-
import { backspace } from '../../util/keymaps';
|
|
7
|
-
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
8
6
|
export const DeletableEmojiTooltipContent = () => {
|
|
9
7
|
const {
|
|
10
8
|
formatMessage
|
|
@@ -13,15 +11,4 @@ export const DeletableEmojiTooltipContent = () => {
|
|
|
13
11
|
description: formatMessage(messages.deleteEmojiTooltip),
|
|
14
12
|
keymap: backspace
|
|
15
13
|
});
|
|
16
|
-
};
|
|
17
|
-
export const DeletableEmojiTooltipContentForScreenReader = ({
|
|
18
|
-
emoji
|
|
19
|
-
}) => {
|
|
20
|
-
return /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
21
|
-
id: `screenreader-emoji-${emoji.id}`
|
|
22
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.deleteEmojiTooltipForScreenreader, {
|
|
23
|
-
values: {
|
|
24
|
-
shortName: emoji.shortName
|
|
25
|
-
}
|
|
26
|
-
})));
|
|
27
14
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
5
|
+
import { messages } from '../i18n';
|
|
6
|
+
export const DeletableEmojiTooltipContentForScreenReader = ({
|
|
7
|
+
emoji
|
|
8
|
+
}) => {
|
|
9
|
+
return /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
10
|
+
id: `screenreader-emoji-${emoji.id}`
|
|
11
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.deleteEmojiTooltipForScreenreader, {
|
|
12
|
+
values: {
|
|
13
|
+
shortName: emoji.shortName
|
|
14
|
+
}
|
|
15
|
+
})));
|
|
16
|
+
};
|