@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { MAX_ORDINAL } from '../../util/constants';
|
|
4
|
+
/**
|
|
5
|
+
* A comparator that will sort higher an emoji which matches the query string earliest in the indicated
|
|
6
|
+
* property.
|
|
7
|
+
*/
|
|
8
|
+
export var QueryStringPositionMatchComparator = /*#__PURE__*/function () {
|
|
9
|
+
/**
|
|
10
|
+
* @param query the query to match
|
|
11
|
+
* @param propertyToCompare the property of EmojiDescription to check for query within
|
|
12
|
+
*/
|
|
13
|
+
function QueryStringPositionMatchComparator(query, propertyToCompare) {
|
|
14
|
+
_classCallCheck(this, QueryStringPositionMatchComparator);
|
|
15
|
+
this.query = query;
|
|
16
|
+
if (!propertyToCompare) {
|
|
17
|
+
throw new Error('propertyToCompare is required');
|
|
18
|
+
}
|
|
19
|
+
this.propertyName = propertyToCompare;
|
|
20
|
+
}
|
|
21
|
+
return _createClass(QueryStringPositionMatchComparator, [{
|
|
22
|
+
key: "getScore",
|
|
23
|
+
value: function getScore(emoji) {
|
|
24
|
+
// It is fine to do override the null check here because we are checking
|
|
25
|
+
// it on the constructor.
|
|
26
|
+
var propertyValue = emoji[this.propertyName];
|
|
27
|
+
var score = propertyValue ? propertyValue.indexOf(this.query) : MAX_ORDINAL;
|
|
28
|
+
return score === -1 ? MAX_ORDINAL : score;
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "compare",
|
|
32
|
+
value: function compare(e1, e2) {
|
|
33
|
+
return this.getScore(e1) - this.getScore(e2);
|
|
34
|
+
}
|
|
35
|
+
}]);
|
|
36
|
+
}();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { MAX_ORDINAL } from '../../util/constants';
|
|
4
|
+
import { isEmojiVariationDescription } from '../../util/is-emoji-variation-description';
|
|
5
|
+
/**
|
|
6
|
+
* Order two emoji such as the one which is more frequently used comes first. If neither have any usage
|
|
7
|
+
* information then leave their order unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export var UsageFrequencyComparator = /*#__PURE__*/function () {
|
|
10
|
+
// A Map of emoji base Id to their order in a least of most frequently used
|
|
11
|
+
|
|
12
|
+
function UsageFrequencyComparator(orderedIds) {
|
|
13
|
+
var _this = this;
|
|
14
|
+
_classCallCheck(this, UsageFrequencyComparator);
|
|
15
|
+
this.positionLookup = new Map();
|
|
16
|
+
// Make ordering start from 1 to avoid having zero in the map (which is falsey)
|
|
17
|
+
orderedIds.map(function (id, index) {
|
|
18
|
+
return _this.positionLookup.set(id, index + 1);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return _createClass(UsageFrequencyComparator, [{
|
|
22
|
+
key: "compare",
|
|
23
|
+
value: function compare(e1, e2) {
|
|
24
|
+
if (!e1.id || !e2.id) {
|
|
25
|
+
return 0; // this shouldn't occur. Leave position unchanged if there is any missing id.
|
|
26
|
+
}
|
|
27
|
+
var i1 = this.getPositionInOrder(e1);
|
|
28
|
+
var i2 = this.getPositionInOrder(e2);
|
|
29
|
+
return i1 - i2;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the ordinal representing the position of this emoji.
|
|
34
|
+
*
|
|
35
|
+
* @param id the id of the emoji
|
|
36
|
+
*/
|
|
37
|
+
}, {
|
|
38
|
+
key: "getPositionInOrder",
|
|
39
|
+
value: function getPositionInOrder(emoji) {
|
|
40
|
+
var id = emoji.id ? emoji.id : '0';
|
|
41
|
+
if (isEmojiVariationDescription(emoji)) {
|
|
42
|
+
id = emoji.baseId;
|
|
43
|
+
}
|
|
44
|
+
var position = this.positionLookup.get(id);
|
|
45
|
+
if (position) {
|
|
46
|
+
return position;
|
|
47
|
+
} else {
|
|
48
|
+
return MAX_ORDINAL;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}]);
|
|
52
|
+
}();
|
|
@@ -3,11 +3,12 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
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
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 { isEmojiVariationDescription } from '../../util/type-helpers';
|
|
7
|
-
import { localStoragePrefix } from '../../util/constants';
|
|
8
6
|
import DuplicateLimitedQueue from '../../util/DuplicateLimitedQueue';
|
|
9
7
|
import StoredDuplicateLimitedQueue from '../../util/StoredDuplicateLimitedQueue';
|
|
8
|
+
import { localStoragePrefix } from '../../util/constants';
|
|
9
|
+
import { isEmojiVariationDescription } from '../../util/is-emoji-variation-description';
|
|
10
10
|
import storageAvailable from '../../util/storage-available';
|
|
11
|
+
import { Gateway } from './Gateway';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Keeps track of the last 150 emoji usages, although limiting the maximum count for a single emoji to 25 to
|
|
@@ -83,47 +84,4 @@ _defineProperty(UsageFrequencyTracker, "queueOptions", {
|
|
|
83
84
|
storagePrefix: localStoragePrefix,
|
|
84
85
|
maxDuplicates: 25,
|
|
85
86
|
minUniqueItems: 5
|
|
86
|
-
});
|
|
87
|
-
export var Gateway = /*#__PURE__*/function () {
|
|
88
|
-
function Gateway(maximumPermitted) {
|
|
89
|
-
_classCallCheck(this, Gateway);
|
|
90
|
-
if (maximumPermitted < 1) {
|
|
91
|
-
throw new RangeError('The maximumPermitted parameter must be 1 or more.');
|
|
92
|
-
}
|
|
93
|
-
this.maximumPermitted = maximumPermitted;
|
|
94
|
-
this.count = 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Run the supplied function if the count of already submitted work allows it. Drop the work
|
|
99
|
-
* if it's not allowed to run.
|
|
100
|
-
*
|
|
101
|
-
* Will return true if the function has been submitted or false if it was not submitted.
|
|
102
|
-
*/
|
|
103
|
-
return _createClass(Gateway, [{
|
|
104
|
-
key: "submit",
|
|
105
|
-
value: function submit(f) {
|
|
106
|
-
var _this2 = this;
|
|
107
|
-
if (this.count >= this.maximumPermitted) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
this.count++;
|
|
111
|
-
var wrappedFunc = function wrappedFunc() {
|
|
112
|
-
try {
|
|
113
|
-
f();
|
|
114
|
-
} finally {
|
|
115
|
-
_this2.completed();
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
if (typeof window !== 'undefined') {
|
|
119
|
-
window.setTimeout(wrappedFunc);
|
|
120
|
-
}
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
}, {
|
|
124
|
-
key: "completed",
|
|
125
|
-
value: function completed() {
|
|
126
|
-
this.count--;
|
|
127
|
-
}
|
|
128
|
-
}]);
|
|
129
|
-
}();
|
|
87
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _construct from "@babel/runtime/helpers/construct";
|
|
2
|
+
import { AlphabeticalShortnameComparator } from './AlphabeticalShortnameComparator';
|
|
3
|
+
import { AsciiMatchComparator } from './AsciiMatchComparator';
|
|
4
|
+
import { ChainedEmojiComparator } from './ChainedEmojiComparator';
|
|
5
|
+
import { ExactShortNameMatchComparator } from './ExactShortNameMatchComparator';
|
|
6
|
+
import { OrderComparator } from './OrderComparator';
|
|
7
|
+
import { QueryStringPositionMatchComparator } from './QueryStringPositionMatchComparator';
|
|
8
|
+
import { UsageFrequencyComparator } from './UsageFrequencyComparator';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create the default sort comparator to be used for the user queries against emoji
|
|
12
|
+
*
|
|
13
|
+
* @param query the query used in the search to be sorted. Any colons will be stripped from the query and it will be
|
|
14
|
+
* converted to lowercase.
|
|
15
|
+
* @param orderedIds the id of emoji ordered by how frequently they are used
|
|
16
|
+
*/
|
|
17
|
+
export function createSearchEmojiComparator(query, orderedIds) {
|
|
18
|
+
var textQuery = query ? query.replace(/:/g, '').toLowerCase().trim() : undefined;
|
|
19
|
+
var comparators = [];
|
|
20
|
+
if (query) {
|
|
21
|
+
comparators.push(new AsciiMatchComparator(query));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Add the comparators to the 'chain'. The order of adding each comparator is important to the sort that is applied by the
|
|
25
|
+
// ChainedEmojiComparator. (Which is why you may see the same 'if' a few times.)
|
|
26
|
+
|
|
27
|
+
if (textQuery) {
|
|
28
|
+
comparators.push(new ExactShortNameMatchComparator(textQuery));
|
|
29
|
+
}
|
|
30
|
+
if (orderedIds && orderedIds.length) {
|
|
31
|
+
comparators.push(new UsageFrequencyComparator(orderedIds));
|
|
32
|
+
}
|
|
33
|
+
if (textQuery) {
|
|
34
|
+
comparators.push(new QueryStringPositionMatchComparator(textQuery, 'shortName'), new QueryStringPositionMatchComparator(textQuery, 'name'));
|
|
35
|
+
}
|
|
36
|
+
comparators.push(OrderComparator.Instance, AlphabeticalShortnameComparator.Instance);
|
|
37
|
+
var comparator = _construct(ChainedEmojiComparator, comparators);
|
|
38
|
+
comparator.compare = comparator.compare.bind(comparator);
|
|
39
|
+
return comparator;
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChainedEmojiComparator } from './ChainedEmojiComparator';
|
|
2
|
+
import { EmojiTypeComparator } from './EmojiTypeComparator';
|
|
3
|
+
import { OrderComparator } from './OrderComparator';
|
|
4
|
+
import { UsageFrequencyComparator } from './UsageFrequencyComparator';
|
|
5
|
+
export function createUsageOnlyEmojiComparator(orderedIds) {
|
|
6
|
+
var comparator = new ChainedEmojiComparator(new UsageFrequencyComparator(orderedIds), new EmojiTypeComparator(), OrderComparator.Instance);
|
|
7
|
+
comparator.compare = comparator.compare.bind(comparator);
|
|
8
|
+
return comparator;
|
|
9
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
5
|
+
import debug from '../../util/logger';
|
|
6
|
+
import { getRequiredRepresentation } from './getRequiredRepresentation';
|
|
7
|
+
var isUnsupportedBrowser = function isUnsupportedBrowser() {
|
|
8
|
+
var isIE = /*@cc_on!@*/false || !!document.documentMode; // Internet Explorer 6-11
|
|
9
|
+
var isEdge = !isIE && !!window.StyleMedia; // Edge 20+
|
|
10
|
+
|
|
11
|
+
return isIE || isEdge;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* For browsers that support caching for resources
|
|
16
|
+
* regardless of originally supplied headers (basically everything but Firefox).
|
|
17
|
+
*/
|
|
18
|
+
export var BrowserCacheStrategy = /*#__PURE__*/function () {
|
|
19
|
+
function BrowserCacheStrategy(mediaImageLoader) {
|
|
20
|
+
_classCallCheck(this, BrowserCacheStrategy);
|
|
21
|
+
_defineProperty(this, "cachedImageUrls", new Set());
|
|
22
|
+
debug('BrowserCacheStrategy');
|
|
23
|
+
this.mediaImageLoader = mediaImageLoader;
|
|
24
|
+
}
|
|
25
|
+
return _createClass(BrowserCacheStrategy, [{
|
|
26
|
+
key: "loadEmoji",
|
|
27
|
+
value: function loadEmoji(emoji, useAlt) {
|
|
28
|
+
var _this = this;
|
|
29
|
+
var representation = getRequiredRepresentation(emoji, useAlt);
|
|
30
|
+
if (!isMediaRepresentation(representation)) {
|
|
31
|
+
return emoji;
|
|
32
|
+
}
|
|
33
|
+
var mediaPath = representation.mediaPath;
|
|
34
|
+
if (this.cachedImageUrls.has(mediaPath)) {
|
|
35
|
+
// Already cached
|
|
36
|
+
return emoji;
|
|
37
|
+
}
|
|
38
|
+
return this.mediaImageLoader.loadMediaImage(mediaPath).then(function () {
|
|
39
|
+
// Media is loaded, can use original URL now, so just return original emoji
|
|
40
|
+
_this.cachedImageUrls.add(mediaPath);
|
|
41
|
+
return emoji;
|
|
42
|
+
}).catch(function () {
|
|
43
|
+
return undefined;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "optimisticRendering",
|
|
48
|
+
value: function optimisticRendering() {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}], [{
|
|
52
|
+
key: "supported",
|
|
53
|
+
value: function supported(mediaPath, mediaImageLoader) {
|
|
54
|
+
// IE/Edge uses memory cache strategy else images can fail to load
|
|
55
|
+
// from a clean cache/if they are downloaded from the service
|
|
56
|
+
// TODO: fix as a part of FS-1592
|
|
57
|
+
if (isUnsupportedBrowser()) {
|
|
58
|
+
return Promise.resolve(false);
|
|
59
|
+
}
|
|
60
|
+
return mediaImageLoader.loadMediaImage(mediaPath).then(function () {
|
|
61
|
+
return (
|
|
62
|
+
// Image should be cached in browser, if supported it should be accessible from the cache by an <img/>
|
|
63
|
+
// Try to load without via image to confirm this support (this fails in Firefox)
|
|
64
|
+
new Promise(function (resolve) {
|
|
65
|
+
var img = new Image();
|
|
66
|
+
img.addEventListener('load', function () {
|
|
67
|
+
resolve(true);
|
|
68
|
+
});
|
|
69
|
+
img.addEventListener('error', function () {
|
|
70
|
+
resolve(false);
|
|
71
|
+
});
|
|
72
|
+
img.src = mediaPath;
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
}).catch(function () {
|
|
76
|
+
return false;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}]);
|
|
80
|
+
}();
|
|
@@ -1,142 +1,17 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
5
|
+
import { isPromise } from '../../util/is-promise';
|
|
6
6
|
import debug from '../../util/logger';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
var
|
|
12
|
-
var isIE = /*@cc_on!@*/false || !!document.documentMode; // Internet Explorer 6-11
|
|
13
|
-
var isEdge = !isIE && !!window.StyleMedia; // Edge 20+
|
|
7
|
+
import { BrowserCacheStrategy } from './BrowserCacheStrategy';
|
|
8
|
+
import { getRequiredRepresentation } from './getRequiredRepresentation';
|
|
9
|
+
import MediaImageLoader from './MediaImageLoader';
|
|
10
|
+
import { MemoryCacheStrategy } from './MemoryCacheStrategy';
|
|
11
|
+
export var maxImageCached = 1000;
|
|
14
12
|
|
|
15
|
-
return isIE || isEdge;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* For browsers that support caching for resources
|
|
19
|
-
* regardless of originally supplied headers (basically everything but Firefox).
|
|
20
|
-
*/
|
|
21
|
-
export var BrowserCacheStrategy = /*#__PURE__*/function () {
|
|
22
|
-
function BrowserCacheStrategy(mediaImageLoader) {
|
|
23
|
-
_classCallCheck(this, BrowserCacheStrategy);
|
|
24
|
-
_defineProperty(this, "cachedImageUrls", new Set());
|
|
25
|
-
debug('BrowserCacheStrategy');
|
|
26
|
-
this.mediaImageLoader = mediaImageLoader;
|
|
27
|
-
}
|
|
28
|
-
return _createClass(BrowserCacheStrategy, [{
|
|
29
|
-
key: "loadEmoji",
|
|
30
|
-
value: function loadEmoji(emoji, useAlt) {
|
|
31
|
-
var _this = this;
|
|
32
|
-
var representation = getRequiredRepresentation(emoji, useAlt);
|
|
33
|
-
if (!isMediaRepresentation(representation)) {
|
|
34
|
-
return emoji;
|
|
35
|
-
}
|
|
36
|
-
var mediaPath = representation.mediaPath;
|
|
37
|
-
if (this.cachedImageUrls.has(mediaPath)) {
|
|
38
|
-
// Already cached
|
|
39
|
-
return emoji;
|
|
40
|
-
}
|
|
41
|
-
return this.mediaImageLoader.loadMediaImage(mediaPath).then(function () {
|
|
42
|
-
// Media is loaded, can use original URL now, so just return original emoji
|
|
43
|
-
_this.cachedImageUrls.add(mediaPath);
|
|
44
|
-
return emoji;
|
|
45
|
-
}).catch(function () {
|
|
46
|
-
return undefined;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
key: "optimisticRendering",
|
|
51
|
-
value: function optimisticRendering() {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
}], [{
|
|
55
|
-
key: "supported",
|
|
56
|
-
value: function supported(mediaPath, mediaImageLoader) {
|
|
57
|
-
// IE/Edge uses memory cache strategy else images can fail to load
|
|
58
|
-
// from a clean cache/if they are downloaded from the service
|
|
59
|
-
// TODO: fix as a part of FS-1592
|
|
60
|
-
if (isUnsupportedBrowser()) {
|
|
61
|
-
return Promise.resolve(false);
|
|
62
|
-
}
|
|
63
|
-
return mediaImageLoader.loadMediaImage(mediaPath).then(function () {
|
|
64
|
-
return (
|
|
65
|
-
// Image should be cached in browser, if supported it should be accessible from the cache by an <img/>
|
|
66
|
-
// Try to load without via image to confirm this support (this fails in Firefox)
|
|
67
|
-
new Promise(function (resolve) {
|
|
68
|
-
var img = new Image();
|
|
69
|
-
img.addEventListener('load', function () {
|
|
70
|
-
resolve(true);
|
|
71
|
-
});
|
|
72
|
-
img.addEventListener('error', function () {
|
|
73
|
-
resolve(false);
|
|
74
|
-
});
|
|
75
|
-
img.src = mediaPath;
|
|
76
|
-
})
|
|
77
|
-
);
|
|
78
|
-
}).catch(function () {
|
|
79
|
-
return false;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}]);
|
|
83
|
-
}();
|
|
84
|
-
var maxImageCached = 1000;
|
|
85
13
|
// Don't cache images large than this - dataUrl size in characters
|
|
86
|
-
var maxImageSize = 10000;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* For browsers that do no cache images without equivalent headers (e.g. Firefox).
|
|
90
|
-
*
|
|
91
|
-
* Images are cached in memory in a LRU cache. Images considered too large,
|
|
92
|
-
* are not cached, but retrieved each time.
|
|
93
|
-
*
|
|
94
|
-
* Images are still cached by the browser, but loading in asynchronous with
|
|
95
|
-
* small delay noticable to the end user.
|
|
96
|
-
*/
|
|
97
|
-
export var MemoryCacheStrategy = /*#__PURE__*/function () {
|
|
98
|
-
function MemoryCacheStrategy(mediaImageLoader) {
|
|
99
|
-
_classCallCheck(this, MemoryCacheStrategy);
|
|
100
|
-
debug('MemoryCacheStrategy');
|
|
101
|
-
this.mediaImageLoader = mediaImageLoader;
|
|
102
|
-
this.dataURLCache = new LRUMap(maxImageCached);
|
|
103
|
-
}
|
|
104
|
-
return _createClass(MemoryCacheStrategy, [{
|
|
105
|
-
key: "loadEmoji",
|
|
106
|
-
value: function loadEmoji(emoji, useAlt) {
|
|
107
|
-
var _this2 = this;
|
|
108
|
-
var representation = getRequiredRepresentation(emoji, useAlt);
|
|
109
|
-
if (!isMediaRepresentation(representation)) {
|
|
110
|
-
return emoji;
|
|
111
|
-
}
|
|
112
|
-
var mediaPath = representation.mediaPath;
|
|
113
|
-
var dataURL = this.dataURLCache.get(mediaPath);
|
|
114
|
-
if (dataURL) {
|
|
115
|
-
// Already cached
|
|
116
|
-
return convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Not cached, load
|
|
120
|
-
return this.mediaImageLoader.loadMediaImage(mediaPath).then(function (dataURL) {
|
|
121
|
-
var loadedEmoji = convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
122
|
-
if (dataURL.length <= maxImageSize) {
|
|
123
|
-
// Only cache if not large than max size
|
|
124
|
-
_this2.dataURLCache.set(mediaPath, dataURL);
|
|
125
|
-
} else {
|
|
126
|
-
debug('No caching as image is too large', dataURL.length, dataURL.slice(0, 15), emoji.shortName);
|
|
127
|
-
}
|
|
128
|
-
return loadedEmoji;
|
|
129
|
-
}).catch(function () {
|
|
130
|
-
return undefined;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
key: "optimisticRendering",
|
|
135
|
-
value: function optimisticRendering() {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
}]);
|
|
139
|
-
}();
|
|
14
|
+
export var maxImageSize = 10000;
|
|
140
15
|
|
|
141
16
|
/**
|
|
142
17
|
* Provides a cache for Media Emoji.
|
|
@@ -188,18 +63,18 @@ var MediaEmojiCache = /*#__PURE__*/function () {
|
|
|
188
63
|
}, {
|
|
189
64
|
key: "getCache",
|
|
190
65
|
value: function getCache(url) {
|
|
191
|
-
var
|
|
66
|
+
var _this = this;
|
|
192
67
|
if (this.cache) {
|
|
193
68
|
return this.cache;
|
|
194
69
|
}
|
|
195
70
|
this.waitingInitUrls.push(url);
|
|
196
71
|
if (!this.cacheLoading) {
|
|
197
72
|
this.cacheLoading = this.initCache().then(function (cache) {
|
|
198
|
-
|
|
199
|
-
|
|
73
|
+
_this.cache = cache;
|
|
74
|
+
_this.cacheLoading = undefined;
|
|
200
75
|
return cache;
|
|
201
76
|
}).catch(function (err) {
|
|
202
|
-
|
|
77
|
+
_this.cacheLoading = undefined;
|
|
203
78
|
throw err;
|
|
204
79
|
});
|
|
205
80
|
}
|
|
@@ -208,20 +83,20 @@ var MediaEmojiCache = /*#__PURE__*/function () {
|
|
|
208
83
|
}, {
|
|
209
84
|
key: "initCache",
|
|
210
85
|
value: function initCache() {
|
|
211
|
-
var
|
|
86
|
+
var _this2 = this;
|
|
212
87
|
var url = this.waitingInitUrls.pop();
|
|
213
88
|
if (!url) {
|
|
214
89
|
return Promise.reject('Unable to initialise cache based on provided url(s)');
|
|
215
90
|
}
|
|
216
91
|
return BrowserCacheStrategy.supported(url, this.mediaImageLoader).then(function (supported) {
|
|
217
|
-
|
|
218
|
-
|
|
92
|
+
_this2.waitingInitUrls = []; // clear
|
|
93
|
+
_this2.cacheLoading = undefined;
|
|
219
94
|
if (supported) {
|
|
220
|
-
return new BrowserCacheStrategy(
|
|
95
|
+
return new BrowserCacheStrategy(_this2.mediaImageLoader);
|
|
221
96
|
}
|
|
222
|
-
return new MemoryCacheStrategy(
|
|
97
|
+
return new MemoryCacheStrategy(_this2.mediaImageLoader);
|
|
223
98
|
}).catch(function () {
|
|
224
|
-
return
|
|
99
|
+
return _this2.initCache();
|
|
225
100
|
});
|
|
226
101
|
}
|
|
227
102
|
}]);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import { LRUMap } from 'lru_map';
|
|
4
|
+
import { convertMediaToImageEmoji } from '../../util/convert-media-to-image-emoji';
|
|
5
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
6
|
+
import debug from '../../util/logger';
|
|
7
|
+
import { maxImageCached, maxImageSize } from './MediaEmojiCache';
|
|
8
|
+
import { getRequiredRepresentation } from './getRequiredRepresentation';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* For browsers that do no cache images without equivalent headers (e.g. Firefox).
|
|
12
|
+
*
|
|
13
|
+
* Images are cached in memory in a LRU cache. Images considered too large,
|
|
14
|
+
* are not cached, but retrieved each time.
|
|
15
|
+
*
|
|
16
|
+
* Images are still cached by the browser, but loading in asynchronous with
|
|
17
|
+
* small delay noticable to the end user.
|
|
18
|
+
*/
|
|
19
|
+
export var MemoryCacheStrategy = /*#__PURE__*/function () {
|
|
20
|
+
function MemoryCacheStrategy(mediaImageLoader) {
|
|
21
|
+
_classCallCheck(this, MemoryCacheStrategy);
|
|
22
|
+
debug('MemoryCacheStrategy');
|
|
23
|
+
this.mediaImageLoader = mediaImageLoader;
|
|
24
|
+
this.dataURLCache = new LRUMap(maxImageCached);
|
|
25
|
+
}
|
|
26
|
+
return _createClass(MemoryCacheStrategy, [{
|
|
27
|
+
key: "loadEmoji",
|
|
28
|
+
value: function loadEmoji(emoji, useAlt) {
|
|
29
|
+
var _this = this;
|
|
30
|
+
var representation = getRequiredRepresentation(emoji, useAlt);
|
|
31
|
+
if (!isMediaRepresentation(representation)) {
|
|
32
|
+
return emoji;
|
|
33
|
+
}
|
|
34
|
+
var mediaPath = representation.mediaPath;
|
|
35
|
+
var dataURL = this.dataURLCache.get(mediaPath);
|
|
36
|
+
if (dataURL) {
|
|
37
|
+
// Already cached
|
|
38
|
+
return convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Not cached, load
|
|
42
|
+
return this.mediaImageLoader.loadMediaImage(mediaPath).then(function (dataURL) {
|
|
43
|
+
var loadedEmoji = convertMediaToImageEmoji(emoji, dataURL, useAlt);
|
|
44
|
+
if (dataURL.length <= maxImageSize) {
|
|
45
|
+
// Only cache if not large than max size
|
|
46
|
+
_this.dataURLCache.set(mediaPath, dataURL);
|
|
47
|
+
} else {
|
|
48
|
+
debug('No caching as image is too large', dataURL.length, dataURL.slice(0, 15), emoji.shortName);
|
|
49
|
+
}
|
|
50
|
+
return loadedEmoji;
|
|
51
|
+
}).catch(function () {
|
|
52
|
+
return undefined;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "optimisticRendering",
|
|
57
|
+
value: function optimisticRendering() {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
}();
|
|
@@ -8,14 +8,20 @@ var _excluded = ["altRepresentations"];
|
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
12
11
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
13
12
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
|
-
import {
|
|
13
|
+
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
14
|
+
import { buildEmojiDescriptionWithAltRepresentation } from '../../util/build-emoji-description-with-alt-representation';
|
|
15
|
+
import { convertImageToMediaRepresentation } from '../../util/convert-image-to-media-representation';
|
|
16
|
+
import { isLoadedMediaEmoji } from '../../util/is-loaded-media-emoji';
|
|
17
|
+
import { isMediaEmoji } from '../../util/is-media-emoji';
|
|
18
|
+
import { isMediaRepresentation } from '../../util/is-media-representation';
|
|
19
|
+
import debug from '../../util/logger';
|
|
20
|
+
import { denormaliseEmojiServiceResponse } from '../denormaliseEmojiServiceResponse';
|
|
21
|
+
import { emojiRequest } from '../emojiRequest';
|
|
22
|
+
import { getAltRepresentation } from '../getAltRepresentation';
|
|
15
23
|
import MediaEmojiCache from './MediaEmojiCache';
|
|
16
|
-
import { denormaliseEmojiServiceResponse, emojiRequest, getAltRepresentation } from '../EmojiUtils';
|
|
17
24
|
import TokenManager from './TokenManager';
|
|
18
|
-
import debug from '../../util/logger';
|
|
19
25
|
// Assume media is 95% of total upload time.
|
|
20
26
|
export var mediaProportionOfProgress = 95 / 100;
|
|
21
27
|
var SiteEmojiResource = /*#__PURE__*/function () {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getPixelRatio } from './getPixelRatio';
|
|
2
|
+
var getHeight = function getHeight(fitToHeight) {
|
|
3
|
+
return getPixelRatio() > 1 ? fitToHeight * 2 : fitToHeight;
|
|
4
|
+
};
|
|
5
|
+
export var shouldUseAltRepresentation = function shouldUseAltRepresentation(emoji, fitToHeight) {
|
|
6
|
+
return !!(fitToHeight && emoji.altRepresentation && emoji.representation && 'height' in emoji.representation && getHeight(fitToHeight) > emoji.representation.height);
|
|
7
|
+
};
|
|
@@ -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 var supportsUploadFeature = function supportsUploadFeature(emojiProvider) {
|
|
9
|
+
var 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
|
+
var styles = {
|
|
16
|
+
icon: "_18u0r5cr _2hwx1i6y"
|
|
17
|
+
};
|
|
18
|
+
var addCustomEmoji = null;
|
|
19
|
+
var addCustomEmojiButton = null;
|
|
20
|
+
export var AddOwnEmoji = function AddOwnEmoji(props) {
|
|
21
|
+
var onOpenUpload = props.onOpenUpload,
|
|
22
|
+
uploadEnabled = props.uploadEnabled;
|
|
23
|
+
var handleOpenUpload = useCallback(function (event) {
|
|
24
|
+
if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
}
|
|
28
|
+
onOpenUpload();
|
|
29
|
+
}, [onOpenUpload]);
|
|
30
|
+
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
"data-testid": uploadEmojiTestId,
|
|
32
|
+
className: ax(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
33
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, function (label) {
|
|
34
|
+
return /*#__PURE__*/React.createElement(AkButton, {
|
|
35
|
+
onClick: handleOpenUpload,
|
|
36
|
+
iconBefore: /*#__PURE__*/React.createElement(Box, {
|
|
37
|
+
xcss: styles.icon
|
|
38
|
+
}, /*#__PURE__*/React.createElement(AddIcon, {
|
|
39
|
+
color: "currentColor",
|
|
40
|
+
label: ""
|
|
41
|
+
})),
|
|
42
|
+
appearance: "subtle"
|
|
43
|
+
// TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
|
|
45
|
+
,
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
48
|
+
className: ax(["_p12f3sup", emojiPickerAddEmoji]),
|
|
49
|
+
tabIndex: 0,
|
|
50
|
+
id: "add-custom-emoji"
|
|
51
|
+
}, label);
|
|
52
|
+
})));
|
|
53
|
+
};
|