@atlaskit/emoji 67.0.4 → 67.0.5
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 +6 -0
- package/dist/cjs/admin.js +0 -2
- package/dist/cjs/api/EmojiLoader.js +1 -8
- package/dist/cjs/api/EmojiRepository.js +16 -80
- package/dist/cjs/api/EmojiRepositoryRegex.js +2 -0
- package/dist/cjs/api/EmojiResource.js +20 -170
- package/dist/cjs/api/EmojiUtils.js +27 -67
- package/dist/cjs/api/internal/Comparators.js +8 -62
- package/dist/cjs/api/internal/UsageFrequencyTracker.js +4 -34
- package/dist/cjs/api/media/MediaEmojiCache.js +8 -58
- package/dist/cjs/api/media/MediaImageLoader.js +4 -28
- package/dist/cjs/api/media/SiteEmojiResource.js +14 -55
- package/dist/cjs/api/media/TokenManager.js +4 -18
- package/dist/cjs/components/common/CachingEmoji.js +18 -52
- package/dist/cjs/components/common/DeleteButton.js +0 -10
- package/dist/cjs/components/common/Emoji.js +44 -102
- package/dist/cjs/components/common/EmojiActions.js +25 -61
- package/dist/cjs/components/common/EmojiButton.js +5 -18
- package/dist/cjs/components/common/EmojiDeletePreview.js +7 -38
- package/dist/cjs/components/common/EmojiErrorMessage.js +3 -9
- package/dist/cjs/components/common/EmojiPlaceholder.js +7 -16
- package/dist/cjs/components/common/EmojiPreviewComponent.js +1 -6
- package/dist/cjs/components/common/EmojiUploadPicker.js +31 -86
- package/dist/cjs/components/common/EmojiUploadPreview.js +7 -36
- package/dist/cjs/components/common/FileChooser.js +5 -18
- package/dist/cjs/components/common/LoadingEmojiComponent.js +5 -24
- package/dist/cjs/components/common/Popup.js +16 -44
- package/dist/cjs/components/common/RecordSelectionDefault.js +0 -7
- package/dist/cjs/components/common/ResourcedEmoji.js +0 -15
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +29 -69
- package/dist/cjs/components/common/RetryableButton.js +4 -19
- package/dist/cjs/components/common/Scrollable.js +6 -36
- package/dist/cjs/components/common/ToneSelector.js +3 -24
- package/dist/cjs/components/common/UfoErrorBoundary.js +1 -19
- package/dist/cjs/components/common/UploadEmoji.js +2 -13
- package/dist/cjs/components/common/internal-types.js +0 -1
- package/dist/cjs/components/common/setSkinToneAriaLabelText.js +0 -6
- package/dist/cjs/components/common/styles.js +9 -17
- package/dist/cjs/components/hooks.js +0 -2
- package/dist/cjs/components/i18n.js +0 -2
- package/dist/cjs/components/picker/CategorySelector.js +4 -50
- package/dist/cjs/components/picker/CategoryTracker.js +3 -14
- package/dist/cjs/components/picker/EmojiPicker.js +3 -42
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +2 -10
- package/dist/cjs/components/picker/EmojiPickerComponent.js +59 -140
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +7 -14
- package/dist/cjs/components/picker/EmojiPickerFooter.js +1 -8
- package/dist/cjs/components/picker/EmojiPickerList.js +32 -83
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +11 -48
- package/dist/cjs/components/picker/EmojiPickerSizes.js +1 -2
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +1 -38
- package/dist/cjs/components/picker/VirtualList.js +11 -41
- package/dist/cjs/components/picker/categories.js +0 -14
- package/dist/cjs/components/picker/styles.js +15 -20
- package/dist/cjs/components/picker/utils.js +0 -4
- package/dist/cjs/components/typeahead/EmojiTypeAhead.js +10 -45
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +11 -74
- package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +7 -37
- package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +10 -63
- package/dist/cjs/components/typeahead/styles.js +2 -4
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +6 -42
- package/dist/cjs/components/uploader/EmojiUploader.js +3 -31
- package/dist/cjs/components/uploader/styles.js +3 -4
- package/dist/cjs/context/EmojiCommonProvider.js +0 -6
- package/dist/cjs/context/EmojiContext.js +0 -2
- package/dist/cjs/context/EmojiContextProvider.js +1 -17
- package/dist/cjs/element.js +0 -4
- package/dist/cjs/hooks/useEmoji.js +5 -20
- package/dist/cjs/hooks/useEmojiContext.js +0 -4
- package/dist/cjs/hooks/usePrevious.js +0 -2
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -30
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/picker.js +0 -2
- package/dist/cjs/resource.js +0 -5
- package/dist/cjs/typeahead.js +0 -3
- package/dist/cjs/types.js +0 -17
- package/dist/cjs/util/DuplicateLimitedQueue.js +13 -31
- package/dist/cjs/util/StoredDuplicateLimitedQueue.js +4 -26
- package/dist/cjs/util/analytics/analytics.js +14 -97
- package/dist/cjs/util/analytics/index.js +0 -4
- package/dist/cjs/util/analytics/samplingUfo.js +3 -59
- package/dist/cjs/util/analytics/ufoExperiences.js +0 -12
- package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +3 -10
- package/dist/cjs/util/constants.js +5 -5
- package/dist/cjs/util/filters.js +0 -4
- package/dist/cjs/util/image.js +3 -18
- package/dist/cjs/util/logger.js +0 -6
- package/dist/cjs/util/mouse.js +3 -6
- package/dist/cjs/util/shared-styles.js +0 -4
- package/dist/cjs/util/storage-available.js +10 -8
- package/dist/cjs/util/type-helpers.js +2 -57
- package/dist/cjs/util/useInView.js +0 -6
- package/dist/cjs/utils.js +0 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiLoader.js +2 -4
- package/dist/es2019/api/EmojiRepository.js +15 -82
- package/dist/es2019/api/EmojiRepositoryRegex.js +2 -0
- package/dist/es2019/api/EmojiResource.js +21 -114
- package/dist/es2019/api/EmojiUtils.js +11 -18
- package/dist/es2019/api/internal/Comparators.js +12 -48
- package/dist/es2019/api/internal/UsageFrequencyTracker.js +7 -24
- package/dist/es2019/api/media/MediaEmojiCache.js +9 -52
- package/dist/es2019/api/media/MediaImageLoader.js +2 -16
- package/dist/es2019/api/media/SiteEmojiResource.js +11 -31
- package/dist/es2019/api/media/TokenManager.js +4 -14
- package/dist/es2019/components/common/CachingEmoji.js +5 -12
- package/dist/es2019/components/common/DeleteButton.js +2 -3
- package/dist/es2019/components/common/Emoji.js +19 -47
- package/dist/es2019/components/common/EmojiActions.js +3 -16
- package/dist/es2019/components/common/EmojiButton.js +0 -5
- package/dist/es2019/components/common/EmojiDeletePreview.js +0 -11
- package/dist/es2019/components/common/EmojiErrorMessage.js +1 -2
- package/dist/es2019/components/common/EmojiPlaceholder.js +0 -5
- package/dist/es2019/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +2 -25
- package/dist/es2019/components/common/EmojiUploadPreview.js +0 -6
- package/dist/es2019/components/common/FileChooser.js +0 -6
- package/dist/es2019/components/common/LoadingEmojiComponent.js +2 -14
- package/dist/es2019/components/common/Popup.js +4 -22
- package/dist/es2019/components/common/RecordSelectionDefault.js +1 -1
- package/dist/es2019/components/common/ResourcedEmoji.js +1 -6
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +2 -13
- package/dist/es2019/components/common/RetryableButton.js +1 -8
- package/dist/es2019/components/common/Scrollable.js +2 -12
- package/dist/es2019/components/common/ToneSelector.js +2 -8
- package/dist/es2019/components/common/UfoErrorBoundary.js +0 -2
- package/dist/es2019/components/common/UploadEmoji.js +2 -3
- package/dist/es2019/components/common/internal-types.js +0 -1
- package/dist/es2019/components/common/styles.js +12 -8
- package/dist/es2019/components/picker/CategorySelector.js +0 -22
- package/dist/es2019/components/picker/CategoryTracker.js +3 -13
- package/dist/es2019/components/picker/EmojiPicker.js +3 -17
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +2 -3
- package/dist/es2019/components/picker/EmojiPickerComponent.js +10 -43
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +0 -2
- package/dist/es2019/components/picker/EmojiPickerFooter.js +0 -2
- package/dist/es2019/components/picker/EmojiPickerList.js +10 -45
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +2 -19
- package/dist/es2019/components/picker/EmojiPickerSizes.js +1 -0
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +1 -8
- package/dist/es2019/components/picker/VirtualList.js +3 -24
- package/dist/es2019/components/picker/styles.js +22 -10
- package/dist/es2019/components/picker/utils.js +0 -1
- package/dist/es2019/components/typeahead/EmojiTypeAhead.js +4 -21
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +0 -42
- package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +0 -7
- package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +4 -45
- package/dist/es2019/components/typeahead/styles.js +2 -1
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +2 -15
- package/dist/es2019/components/uploader/EmojiUploader.js +2 -10
- package/dist/es2019/components/uploader/styles.js +5 -2
- package/dist/es2019/context/EmojiCommonProvider.js +0 -2
- package/dist/es2019/context/EmojiContextProvider.js +0 -1
- package/dist/es2019/hooks/useEmoji.js +2 -6
- package/dist/es2019/hooks/useEmojiContext.js +1 -1
- package/dist/es2019/index.js +12 -6
- package/dist/es2019/types.js +1 -11
- package/dist/es2019/util/DuplicateLimitedQueue.js +13 -35
- package/dist/es2019/util/StoredDuplicateLimitedQueue.js +5 -12
- package/dist/es2019/util/analytics/analytics.js +7 -23
- package/dist/es2019/util/analytics/samplingUfo.js +6 -32
- package/dist/es2019/util/analytics/ufoExperiences.js +0 -3
- package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +3 -7
- package/dist/es2019/util/constants.js +5 -4
- package/dist/es2019/util/filters.js +0 -3
- package/dist/es2019/util/image.js +3 -8
- package/dist/es2019/util/mouse.js +3 -3
- package/dist/es2019/util/storage-available.js +10 -7
- package/dist/es2019/util/type-helpers.js +6 -9
- package/dist/es2019/util/useInView.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiLoader.js +2 -6
- package/dist/esm/api/EmojiRepository.js +16 -71
- package/dist/esm/api/EmojiRepositoryRegex.js +2 -0
- package/dist/esm/api/EmojiResource.js +20 -158
- package/dist/esm/api/EmojiUtils.js +27 -47
- package/dist/esm/api/internal/Comparators.js +12 -53
- package/dist/esm/api/internal/UsageFrequencyTracker.js +5 -29
- package/dist/esm/api/media/MediaEmojiCache.js +9 -55
- package/dist/esm/api/media/MediaImageLoader.js +4 -27
- package/dist/esm/api/media/SiteEmojiResource.js +14 -43
- package/dist/esm/api/media/TokenManager.js +6 -16
- package/dist/esm/components/common/CachingEmoji.js +18 -30
- package/dist/esm/components/common/DeleteButton.js +2 -3
- package/dist/esm/components/common/Emoji.js +44 -78
- package/dist/esm/components/common/EmojiActions.js +25 -40
- package/dist/esm/components/common/EmojiButton.js +4 -9
- package/dist/esm/components/common/EmojiDeletePreview.js +7 -24
- package/dist/esm/components/common/EmojiErrorMessage.js +3 -4
- package/dist/esm/components/common/EmojiPlaceholder.js +6 -11
- package/dist/esm/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +30 -64
- package/dist/esm/components/common/EmojiUploadPreview.js +7 -19
- package/dist/esm/components/common/FileChooser.js +5 -11
- package/dist/esm/components/common/LoadingEmojiComponent.js +4 -20
- package/dist/esm/components/common/Popup.js +16 -36
- package/dist/esm/components/common/RecordSelectionDefault.js +1 -1
- package/dist/esm/components/common/ResourcedEmoji.js +1 -6
- package/dist/esm/components/common/ResourcedEmojiComponent.js +29 -51
- package/dist/esm/components/common/RetryableButton.js +4 -11
- package/dist/esm/components/common/Scrollable.js +6 -29
- package/dist/esm/components/common/ToneSelector.js +3 -13
- package/dist/esm/components/common/UfoErrorBoundary.js +1 -13
- package/dist/esm/components/common/UploadEmoji.js +2 -3
- package/dist/esm/components/common/internal-types.js +0 -1
- package/dist/esm/components/common/setSkinToneAriaLabelText.js +0 -2
- package/dist/esm/components/common/styles.js +12 -9
- package/dist/esm/components/picker/CategorySelector.js +4 -32
- package/dist/esm/components/picker/CategoryTracker.js +3 -13
- package/dist/esm/components/picker/EmojiPicker.js +5 -27
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +4 -5
- package/dist/esm/components/picker/EmojiPickerComponent.js +60 -114
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +6 -8
- package/dist/esm/components/picker/EmojiPickerFooter.js +0 -2
- package/dist/esm/components/picker/EmojiPickerList.js +32 -77
- package/dist/esm/components/picker/EmojiPickerListSearch.js +11 -35
- package/dist/esm/components/picker/EmojiPickerSizes.js +1 -0
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +2 -26
- package/dist/esm/components/picker/VirtualList.js +11 -28
- package/dist/esm/components/picker/styles.js +22 -11
- package/dist/esm/components/picker/utils.js +0 -1
- package/dist/esm/components/typeahead/EmojiTypeAhead.js +11 -39
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +11 -65
- package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +7 -24
- package/dist/esm/components/typeahead/EmojiTypeAheadList.js +10 -53
- package/dist/esm/components/typeahead/styles.js +2 -1
- package/dist/esm/components/uploader/EmojiUploadComponent.js +5 -25
- package/dist/esm/components/uploader/EmojiUploader.js +4 -22
- package/dist/esm/components/uploader/styles.js +5 -2
- package/dist/esm/context/EmojiCommonProvider.js +0 -2
- package/dist/esm/context/EmojiContextProvider.js +1 -6
- package/dist/esm/hooks/useEmoji.js +5 -13
- package/dist/esm/hooks/useEmojiContext.js +1 -1
- package/dist/esm/index.js +12 -6
- package/dist/esm/types.js +1 -11
- package/dist/esm/util/DuplicateLimitedQueue.js +13 -29
- package/dist/esm/util/StoredDuplicateLimitedQueue.js +5 -22
- package/dist/esm/util/analytics/analytics.js +14 -50
- package/dist/esm/util/analytics/samplingUfo.js +3 -51
- package/dist/esm/util/analytics/ufoExperiences.js +0 -3
- package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +3 -7
- package/dist/esm/util/constants.js +5 -4
- package/dist/esm/util/filters.js +0 -3
- package/dist/esm/util/image.js +3 -8
- package/dist/esm/util/logger.js +0 -2
- package/dist/esm/util/mouse.js +3 -3
- package/dist/esm/util/storage-available.js +10 -7
- package/dist/esm/util/type-helpers.js +2 -12
- package/dist/esm/util/useInView.js +0 -2
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
|
|
8
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
-
|
|
10
6
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
11
|
-
|
|
12
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
-
|
|
14
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
-
|
|
16
9
|
export var ufoExperiencesSampled = {};
|
|
17
10
|
export var clearSampled = function clearSampled() {
|
|
18
11
|
var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(ufoExperiencesSampled)),
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
_step;
|
|
21
13
|
try {
|
|
22
14
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
23
15
|
var prop = _step.value;
|
|
@@ -29,6 +21,7 @@ export var clearSampled = function clearSampled() {
|
|
|
29
21
|
_iterator.f();
|
|
30
22
|
}
|
|
31
23
|
};
|
|
24
|
+
|
|
32
25
|
/**
|
|
33
26
|
* A random sampling function
|
|
34
27
|
* sampling algorithm is from @atlassian/jira-coinflip at https://stash.atlassian.com/projects/JIRACLOUD/repos/jira-frontend/browse/src/packages/platform/app-framework/coinflip/src/index.tsx
|
|
@@ -37,31 +30,26 @@ export var clearSampled = function clearSampled() {
|
|
|
37
30
|
* @returns bool, if it passes or not
|
|
38
31
|
*/
|
|
39
32
|
// default sampling function to determine which one to be sampled
|
|
40
|
-
|
|
41
33
|
export var isExperienceSampled = function isExperienceSampled(rate) {
|
|
42
34
|
if (rate === 1) {
|
|
43
35
|
return true;
|
|
44
36
|
}
|
|
45
|
-
|
|
46
37
|
if (rate === 0) {
|
|
47
38
|
return false;
|
|
48
39
|
}
|
|
49
|
-
|
|
50
40
|
return Math.random() * rate <= 1;
|
|
51
41
|
};
|
|
52
|
-
|
|
53
42
|
var hasSampledFromStart = function hasSampledFromStart(experience) {
|
|
54
43
|
if (!ufoExperiencesSampled[experience.id]) {
|
|
55
44
|
return false;
|
|
56
45
|
}
|
|
57
|
-
|
|
58
46
|
if (experience.instanceId) {
|
|
59
47
|
// if the instance of concurrent exp has been sampled from start, allow it.
|
|
60
48
|
return ufoExperiencesSampled[experience.id].sampledInstance[experience.instanceId];
|
|
61
49
|
}
|
|
62
|
-
|
|
63
50
|
return ufoExperiencesSampled[experience.id].sampled;
|
|
64
51
|
};
|
|
52
|
+
|
|
65
53
|
/**
|
|
66
54
|
* This function is a temp solution to reduce the event traffic, as UFO package does not support it.
|
|
67
55
|
*
|
|
@@ -69,8 +57,6 @@ var hasSampledFromStart = function hasSampledFromStart(experience) {
|
|
|
69
57
|
* @param ufoExperience
|
|
70
58
|
* @returns
|
|
71
59
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
60
|
export var withSampling = function withSampling(ufoExperience) {
|
|
75
61
|
var init = function init() {
|
|
76
62
|
if (!ufoExperiencesSampled[ufoExperience.id]) {
|
|
@@ -80,7 +66,6 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
80
66
|
};
|
|
81
67
|
}
|
|
82
68
|
};
|
|
83
|
-
|
|
84
69
|
var start = /*#__PURE__*/function () {
|
|
85
70
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
86
71
|
var isSampled;
|
|
@@ -92,33 +77,25 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
92
77
|
_context.next = 2;
|
|
93
78
|
break;
|
|
94
79
|
}
|
|
95
|
-
|
|
96
80
|
return _context.abrupt("return");
|
|
97
|
-
|
|
98
81
|
case 2:
|
|
99
82
|
isSampled = options.samplingFunc || isExperienceSampled;
|
|
100
|
-
|
|
101
83
|
if (isSampled(options.samplingRate)) {
|
|
102
84
|
_context.next = 7;
|
|
103
85
|
break;
|
|
104
86
|
}
|
|
105
|
-
|
|
106
87
|
if (ufoExperience.instanceId) {
|
|
107
88
|
ufoExperiencesSampled[ufoExperience.id].sampledInstance[ufoExperience.instanceId] = false;
|
|
108
89
|
}
|
|
109
|
-
|
|
110
90
|
ufoExperiencesSampled[ufoExperience.id].sampled = false;
|
|
111
91
|
return _context.abrupt("return");
|
|
112
|
-
|
|
113
92
|
case 7:
|
|
114
93
|
// update sampled records
|
|
115
94
|
if (ufoExperience.instanceId) {
|
|
116
95
|
ufoExperiencesSampled[ufoExperience.id].sampledInstance[ufoExperience.instanceId] = true;
|
|
117
96
|
ufoExperiencesSampled[ufoExperience.id].sampled = true;
|
|
118
97
|
}
|
|
119
|
-
|
|
120
98
|
return _context.abrupt("return", ufoExperience.start(options.startTime));
|
|
121
|
-
|
|
122
99
|
case 9:
|
|
123
100
|
case "end":
|
|
124
101
|
return _context.stop();
|
|
@@ -126,12 +103,10 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
126
103
|
}
|
|
127
104
|
}, _callee);
|
|
128
105
|
}));
|
|
129
|
-
|
|
130
106
|
return function start(_x) {
|
|
131
107
|
return _ref.apply(this, arguments);
|
|
132
108
|
};
|
|
133
109
|
}();
|
|
134
|
-
|
|
135
110
|
var success = /*#__PURE__*/function () {
|
|
136
111
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
|
|
137
112
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -142,12 +117,9 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
142
117
|
_context2.next = 2;
|
|
143
118
|
break;
|
|
144
119
|
}
|
|
145
|
-
|
|
146
120
|
return _context2.abrupt("return", null);
|
|
147
|
-
|
|
148
121
|
case 2:
|
|
149
122
|
return _context2.abrupt("return", ufoExperience.success(config));
|
|
150
|
-
|
|
151
123
|
case 3:
|
|
152
124
|
case "end":
|
|
153
125
|
return _context2.stop();
|
|
@@ -155,12 +127,10 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
155
127
|
}
|
|
156
128
|
}, _callee2);
|
|
157
129
|
}));
|
|
158
|
-
|
|
159
130
|
return function success(_x2) {
|
|
160
131
|
return _ref2.apply(this, arguments);
|
|
161
132
|
};
|
|
162
133
|
}();
|
|
163
|
-
|
|
164
134
|
var failure = /*#__PURE__*/function () {
|
|
165
135
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(config) {
|
|
166
136
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -171,12 +141,9 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
171
141
|
_context3.next = 2;
|
|
172
142
|
break;
|
|
173
143
|
}
|
|
174
|
-
|
|
175
144
|
return _context3.abrupt("return", null);
|
|
176
|
-
|
|
177
145
|
case 2:
|
|
178
146
|
return _context3.abrupt("return", ufoExperience.failure(config));
|
|
179
|
-
|
|
180
147
|
case 3:
|
|
181
148
|
case "end":
|
|
182
149
|
return _context3.stop();
|
|
@@ -184,12 +151,10 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
184
151
|
}
|
|
185
152
|
}, _callee3);
|
|
186
153
|
}));
|
|
187
|
-
|
|
188
154
|
return function failure(_x3) {
|
|
189
155
|
return _ref3.apply(this, arguments);
|
|
190
156
|
};
|
|
191
157
|
}();
|
|
192
|
-
|
|
193
158
|
var abort = /*#__PURE__*/function () {
|
|
194
159
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(config) {
|
|
195
160
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
@@ -200,12 +165,9 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
200
165
|
_context4.next = 2;
|
|
201
166
|
break;
|
|
202
167
|
}
|
|
203
|
-
|
|
204
168
|
return _context4.abrupt("return", null);
|
|
205
|
-
|
|
206
169
|
case 2:
|
|
207
170
|
return _context4.abrupt("return", ufoExperience.abort(config));
|
|
208
|
-
|
|
209
171
|
case 3:
|
|
210
172
|
case "end":
|
|
211
173
|
return _context4.stop();
|
|
@@ -213,44 +175,34 @@ export var withSampling = function withSampling(ufoExperience) {
|
|
|
213
175
|
}
|
|
214
176
|
}, _callee4);
|
|
215
177
|
}));
|
|
216
|
-
|
|
217
178
|
return function abort(_x4) {
|
|
218
179
|
return _ref4.apply(this, arguments);
|
|
219
180
|
};
|
|
220
181
|
}();
|
|
221
|
-
|
|
222
182
|
var addMetadata = function addMetadata(data) {
|
|
223
183
|
if (!hasSampledFromStart(ufoExperience)) {
|
|
224
184
|
return;
|
|
225
185
|
}
|
|
226
|
-
|
|
227
186
|
return ufoExperience.addMetadata(data);
|
|
228
187
|
};
|
|
229
|
-
|
|
230
188
|
var mark = function mark(name, timestamp) {
|
|
231
189
|
if (!hasSampledFromStart(ufoExperience)) {
|
|
232
190
|
return;
|
|
233
191
|
}
|
|
234
|
-
|
|
235
192
|
return ufoExperience.mark(name, timestamp);
|
|
236
193
|
};
|
|
237
|
-
|
|
238
194
|
var markFMP = function markFMP(timestamp) {
|
|
239
195
|
if (!hasSampledFromStart(ufoExperience)) {
|
|
240
196
|
return;
|
|
241
197
|
}
|
|
242
|
-
|
|
243
198
|
return ufoExperience.markFMP(timestamp);
|
|
244
199
|
};
|
|
245
|
-
|
|
246
200
|
var markInlineResponse = function markInlineResponse(timestamp) {
|
|
247
201
|
if (!hasSampledFromStart(ufoExperience)) {
|
|
248
202
|
return;
|
|
249
203
|
}
|
|
250
|
-
|
|
251
204
|
return ufoExperience.markInlineResponse(timestamp);
|
|
252
205
|
};
|
|
253
|
-
|
|
254
206
|
init();
|
|
255
207
|
return _objectSpread(_objectSpread({}, ufoExperience), {}, {
|
|
256
208
|
start: start,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UfoComponentName, UfoEmojiTimings, UfoEmojiTimingsKeys, UfoExperienceName } from '../../types';
|
|
2
2
|
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience, UFOExperience } from '@atlaskit/ufo';
|
|
3
3
|
import { withSampling } from './samplingUfo';
|
|
4
|
-
|
|
5
4
|
var createRenderExperience = function createRenderExperience(componentName) {
|
|
6
5
|
return {
|
|
7
6
|
platform: {
|
|
@@ -11,7 +10,6 @@ var createRenderExperience = function createRenderExperience(componentName) {
|
|
|
11
10
|
performanceType: ExperiencePerformanceTypes.PageSegmentLoad
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
var createInlineExperience = function createInlineExperience(componentName) {
|
|
16
14
|
return {
|
|
17
15
|
platform: {
|
|
@@ -21,7 +19,6 @@ var createInlineExperience = function createInlineExperience(componentName) {
|
|
|
21
19
|
performanceType: ExperiencePerformanceTypes.InlineResult
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
|
-
|
|
25
22
|
var customEmojiTimings = [{
|
|
26
23
|
key: UfoEmojiTimingsKeys.FMP,
|
|
27
24
|
endMark: UfoEmojiTimings.FMP_END
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { withSampling } from './samplingUfo';
|
|
3
|
-
|
|
4
3
|
var useConstructor = function useConstructor(callback) {
|
|
5
4
|
var hasBeenFired = useRef(false);
|
|
6
|
-
|
|
7
5
|
if (!hasBeenFired.current) {
|
|
8
6
|
callback();
|
|
9
7
|
hasBeenFired.current = true;
|
|
10
8
|
}
|
|
11
|
-
|
|
12
9
|
return null;
|
|
13
10
|
};
|
|
11
|
+
|
|
14
12
|
/**
|
|
15
13
|
* A hook to start an experience and to auto abort the experience when the parent component is unmounted.
|
|
16
14
|
* Use this instead of a direct call to `experience.start`. If you need to restart the experience
|
|
17
15
|
* simply trigger an unmount and remount of the parent component.
|
|
18
16
|
* @param experience the experience to start and abort
|
|
19
17
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
18
|
export var useSampledUFOComponentExperience = function useSampledUFOComponentExperience(experience, samplingRate, metadata) {
|
|
23
19
|
useEffect(function () {
|
|
24
20
|
return function () {
|
|
25
21
|
withSampling(experience).abort();
|
|
26
|
-
};
|
|
22
|
+
};
|
|
23
|
+
// we want this cleanup to only happen on unmount so this is a legit use of empty array
|
|
27
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
25
|
}, []);
|
|
29
26
|
useConstructor(function () {
|
|
@@ -31,7 +28,6 @@ export var useSampledUFOComponentExperience = function useSampledUFOComponentExp
|
|
|
31
28
|
samplingRate: samplingRate
|
|
32
29
|
});
|
|
33
30
|
var isMetadataEmpty = Object.keys(experience.metadata).length === 0;
|
|
34
|
-
|
|
35
31
|
if (metadata && isMetadataEmpty) {
|
|
36
32
|
experience.addMetadata(metadata);
|
|
37
33
|
}
|
|
@@ -5,11 +5,11 @@ export var customTitle = 'allUploadsCustomCategory';
|
|
|
5
5
|
export var userCustomTitle = 'userUploadsCustomCategory';
|
|
6
6
|
export var dataURLPrefix = 'data:';
|
|
7
7
|
export var deleteEmojiLabel = 'delete-emoji';
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* A constant used in sorting/ordering to represent a number 'obviously much bigger than any item in the set being handled'.
|
|
10
11
|
* This is used instead of Number.MAX_VALUE since subtraction of MAX_VALUE from itself occassionaly doesn't equal zero exactly :-(
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
13
|
export var MAX_ORDINAL = 100000;
|
|
14
14
|
export var defaultEmojiHeight = 20;
|
|
15
15
|
export var emojiPickerWidth = 350;
|
|
@@ -26,8 +26,9 @@ export var selectedToneStorageKey = "".concat(localStoragePrefix, ".selectedTone
|
|
|
26
26
|
export var defaultCategories = ['PEOPLE', 'NATURE', 'FOODS', 'ACTIVITY', 'PLACES', 'OBJECTS', 'SYMBOLS', 'FLAGS'];
|
|
27
27
|
export var defaultListLimit = 50;
|
|
28
28
|
export var migrationUserId = 'hipchat_migration_emoticons';
|
|
29
|
-
export var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker';
|
|
30
|
-
|
|
31
|
-
export var SAMPLING_RATE_EMOJI_RENDERED_EXP = 20; // This rate is used in fetching emoji resource
|
|
29
|
+
export var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker';
|
|
32
30
|
|
|
31
|
+
// This is the base sampling rate in Emoji
|
|
32
|
+
export var SAMPLING_RATE_EMOJI_RENDERED_EXP = 20;
|
|
33
|
+
// This rate is used in fetching emoji resource
|
|
33
34
|
export var SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP = 100;
|
package/dist/esm/util/filters.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
var toneEmojiShortName = ':raised_hand:';
|
|
2
|
-
|
|
3
2
|
var byShortName = function byShortName(emojis, shortName) {
|
|
4
3
|
return emojis.filter(function (emoji) {
|
|
5
4
|
return emoji.shortName === shortName;
|
|
6
5
|
})[0];
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
var toneEmoji = function toneEmoji(emojis) {
|
|
10
8
|
return byShortName(emojis, toneEmojiShortName);
|
|
11
9
|
};
|
|
12
|
-
|
|
13
10
|
export var getToneEmoji = function getToneEmoji(provider) {
|
|
14
11
|
return provider.findByShortName(toneEmojiShortName);
|
|
15
12
|
};
|
package/dist/esm/util/image.js
CHANGED
|
@@ -15,23 +15,22 @@ export var getNaturalImageSize = function getNaturalImageSize(dataURL) {
|
|
|
15
15
|
export var parseImage = function parseImage(dataURL) {
|
|
16
16
|
return new Promise(function (resolve, reject) {
|
|
17
17
|
var img = new Image();
|
|
18
|
-
|
|
19
18
|
img.onload = function () {
|
|
20
19
|
return resolve({
|
|
21
20
|
src: img.src
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
img.onerror = function () {
|
|
26
24
|
return reject();
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
img.src = dataURL;
|
|
30
27
|
});
|
|
31
28
|
};
|
|
32
29
|
export var hasFileExceededSize = function hasFileExceededSize(file) {
|
|
33
30
|
return file && file.size > maxEmojiSizeInBytes;
|
|
34
|
-
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Duplicates https://bitbucket.org/atlassian/atlaskit/src/0e843df6df8bcd33fa7fc16cc63f11a0f6094957/packages/media-core/src/utils/checkWebpSupport.ts?at=master&fileviewer=file-view-default
|
|
35
34
|
// Didn't want to depend on the whole of media-core just for this util
|
|
36
35
|
|
|
37
36
|
/**
|
|
@@ -39,21 +38,17 @@ export var hasFileExceededSize = function hasFileExceededSize(file) {
|
|
|
39
38
|
* We know that creating a new image in memory and checking its height,
|
|
40
39
|
* later on we cache this value forever.
|
|
41
40
|
*/
|
|
42
|
-
|
|
43
41
|
var isWebpSupported;
|
|
44
42
|
export var checkWebpSupport = function checkWebpSupport() {
|
|
45
43
|
if (isWebpSupported !== undefined) {
|
|
46
44
|
return Promise.resolve(isWebpSupported);
|
|
47
45
|
}
|
|
48
|
-
|
|
49
46
|
return new Promise(function (resolve) {
|
|
50
47
|
var img = new Image();
|
|
51
|
-
|
|
52
48
|
var checkSupport = function checkSupport() {
|
|
53
49
|
isWebpSupported = img.height === 2;
|
|
54
50
|
resolve(isWebpSupported);
|
|
55
51
|
};
|
|
56
|
-
|
|
57
52
|
img.addEventListener('load', checkSupport);
|
|
58
53
|
img.addEventListener('error', checkSupport);
|
|
59
54
|
img.src = 'data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA';
|
package/dist/esm/util/logger.js
CHANGED
|
@@ -15,11 +15,9 @@ export function logStacktrace() {
|
|
|
15
15
|
export default function debug(msg) {
|
|
16
16
|
if (debugEnabled) {
|
|
17
17
|
var _console;
|
|
18
|
-
|
|
19
18
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
20
19
|
args[_key - 1] = arguments[_key];
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
// eslint-disable-next-line no-console
|
|
24
22
|
(_console = console).log.apply(_console, [msg].concat(args));
|
|
25
23
|
}
|
package/dist/esm/util/mouse.js
CHANGED
|
@@ -3,14 +3,14 @@ export function mouseLocation(event) {
|
|
|
3
3
|
x: event.clientX,
|
|
4
4
|
y: event.clientY
|
|
5
5
|
};
|
|
6
|
-
}
|
|
7
|
-
// lastPosition is object (x, y)
|
|
6
|
+
}
|
|
8
7
|
|
|
8
|
+
// Used to prevent invalid mouse move detection on scroll
|
|
9
|
+
// lastPosition is object (x, y)
|
|
9
10
|
export function actualMouseMove(oldPosition, newPosition) {
|
|
10
11
|
if (!oldPosition || oldPosition.x !== newPosition.x || oldPosition.y !== newPosition.y) {
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
export function leftClick(reactEvent) {
|
|
@@ -4,9 +4,7 @@ export default function storageAvailable(type) {
|
|
|
4
4
|
if (typeof window === 'undefined') {
|
|
5
5
|
return false;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
var storage;
|
|
9
|
-
|
|
10
8
|
try {
|
|
11
9
|
storage = window[type];
|
|
12
10
|
var x = '__storage_test__';
|
|
@@ -14,12 +12,17 @@ export default function storageAvailable(type) {
|
|
|
14
12
|
storage.removeItem(x);
|
|
15
13
|
return true;
|
|
16
14
|
} catch (e) {
|
|
17
|
-
return e instanceof DOMException && (
|
|
18
|
-
e.code === 22 || // Firefox
|
|
19
|
-
e.code === 1014 || // test name field too, because code might not be present
|
|
15
|
+
return e instanceof DOMException && (
|
|
20
16
|
// everything except Firefox
|
|
21
|
-
e.
|
|
22
|
-
|
|
17
|
+
e.code === 22 ||
|
|
18
|
+
// Firefox
|
|
19
|
+
e.code === 1014 ||
|
|
20
|
+
// test name field too, because code might not be present
|
|
21
|
+
// everything except Firefox
|
|
22
|
+
e.name === 'QuotaExceededError' ||
|
|
23
|
+
// Firefox
|
|
24
|
+
e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
|
|
25
|
+
// acknowledge QuotaExceededError only if there's something already stored
|
|
23
26
|
storage && storage.length !== 0;
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { messages } from '../components/i18n';
|
|
8
5
|
import { customCategory, dataURLPrefix } from './constants';
|
|
9
6
|
export var isSpriteServiceRepresentation = function isSpriteServiceRepresentation(rep) {
|
|
@@ -53,7 +50,6 @@ export var toOptionalEmojiId = function toOptionalEmojiId(emoji) {
|
|
|
53
50
|
if (!emoji) {
|
|
54
51
|
return undefined;
|
|
55
52
|
}
|
|
56
|
-
|
|
57
53
|
return toEmojiId(emoji);
|
|
58
54
|
};
|
|
59
55
|
export var isEmojiIdEqual = function isEmojiIdEqual(l, r) {
|
|
@@ -63,13 +59,11 @@ export var containsEmojiId = function containsEmojiId(emojis, emojiId) {
|
|
|
63
59
|
if (!emojiId) {
|
|
64
60
|
return false;
|
|
65
61
|
}
|
|
66
|
-
|
|
67
62
|
for (var i = 0; i < emojis.length; i++) {
|
|
68
63
|
if (isEmojiIdEqual(emojis[i], emojiId)) {
|
|
69
64
|
return true;
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
|
-
|
|
73
67
|
return false;
|
|
74
68
|
};
|
|
75
69
|
export var convertImageToMediaRepresentation = function convertImageToMediaRepresentation(rep) {
|
|
@@ -91,26 +85,22 @@ export var convertMediaToImageEmoji = function convertMediaToImageEmoji(emoji, n
|
|
|
91
85
|
var mediaAltRepresentation = emoji.altRepresentation;
|
|
92
86
|
var imgPath = !useAlt ? newImagePath : undefined;
|
|
93
87
|
var altImgPath = useAlt ? newImagePath : undefined;
|
|
94
|
-
|
|
95
88
|
if (!isMediaRepresentation(mediaRepresentation) && !isMediaRepresentation(mediaAltRepresentation)) {
|
|
96
89
|
return emoji;
|
|
97
90
|
}
|
|
98
|
-
|
|
99
91
|
var representation = isMediaRepresentation(mediaRepresentation) ? convertMediaToImageRepresentation(mediaRepresentation, imgPath) : mediaRepresentation;
|
|
100
92
|
var altRepresentation = isMediaRepresentation(mediaAltRepresentation) ? convertMediaToImageRepresentation(mediaAltRepresentation, altImgPath) : mediaAltRepresentation;
|
|
101
|
-
|
|
102
93
|
var baseEmoji = _objectSpread(_objectSpread({}, emoji), {}, {
|
|
103
94
|
representation: representation
|
|
104
95
|
});
|
|
105
|
-
|
|
106
96
|
return buildEmojiDescriptionWithAltRepresentation(baseEmoji, altRepresentation);
|
|
107
|
-
};
|
|
97
|
+
};
|
|
108
98
|
|
|
99
|
+
// Prevent altRepresentation: undefined from being returned in EmojiDescription
|
|
109
100
|
export var buildEmojiDescriptionWithAltRepresentation = function buildEmojiDescriptionWithAltRepresentation(emoji, altRepresentation) {
|
|
110
101
|
if (!altRepresentation) {
|
|
111
102
|
return emoji;
|
|
112
103
|
}
|
|
113
|
-
|
|
114
104
|
return _objectSpread(_objectSpread({}, emoji), {}, {
|
|
115
105
|
altRepresentation: altRepresentation
|
|
116
106
|
});
|
|
@@ -2,11 +2,9 @@ import { useInView as useInViewLib } from 'react-intersection-observer';
|
|
|
2
2
|
import { isIntersectionObserverSupported } from './browser-support';
|
|
3
3
|
export var useInView = function useInView(options) {
|
|
4
4
|
var hookResult = useInViewLib(options);
|
|
5
|
-
|
|
6
5
|
if (!isIntersectionObserverSupported) {
|
|
7
6
|
// Unsupported, return no `ref` and default `inView` true value
|
|
8
7
|
return [undefined, true];
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return hookResult;
|
|
12
10
|
};
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "67.0.
|
|
3
|
+
"version": "67.0.5",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/spinner": "^15.3.0",
|
|
34
34
|
"@atlaskit/textfield": "^5.3.0",
|
|
35
35
|
"@atlaskit/theme": "^12.2.0",
|
|
36
|
-
"@atlaskit/tokens": "^0.
|
|
36
|
+
"@atlaskit/tokens": "^1.0.0",
|
|
37
37
|
"@atlaskit/tooltip": "^17.6.0",
|
|
38
38
|
"@atlaskit/ufo": "^0.1.0",
|
|
39
39
|
"@atlaskit/util-service-support": "^6.1.0",
|