@atlaskit/emoji 72.0.8 → 72.1.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 72.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`67cb56528e699`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/67cb56528e699) -
8
+ Add emojiProviderLookupOrder as an optional override for the shortName-only emoji lookup priority
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 72.0.9
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 72.0.8
4
21
 
5
22
  ### Patch Changes
@@ -26,7 +26,9 @@ var _getEmojiVariation = require("./getEmojiVariation");
26
26
  var _UsageFrequencyTracker = require("./internal/UsageFrequencyTracker");
27
27
  var _createSearchEmojiComparator = require("./internal/createSearchEmojiComparator");
28
28
  var _createUsageOnlyEmojiComparator = require("./internal/createUsageOnlyEmojiComparator");
29
- /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
29
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
30
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
31
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
30
32
  // FS-1097 - duplicated in mentions - extract at some point into a shared library
31
33
  var Tokenizer = /*#__PURE__*/function () {
32
34
  function Tokenizer() {
@@ -77,9 +79,36 @@ var _addAllVariants = function addAllVariants(emoji, fnKey, map) {
77
79
  }
78
80
  }
79
81
  };
80
- var findByKey = function findByKey(map, key) {
82
+ var findByKey = function findByKey(map, key, emojiProviderLookupOrder) {
81
83
  var emojis = map.get(key);
82
84
  if (emojis && emojis.length) {
85
+ if (emojiProviderLookupOrder !== null && emojiProviderLookupOrder !== void 0 && emojiProviderLookupOrder.length) {
86
+ var _iterator = _createForOfIteratorHelper(emojiProviderLookupOrder),
87
+ _step;
88
+ try {
89
+ var _loop = function _loop() {
90
+ var emojiType = _step.value;
91
+ var matchingEmoji = emojis.find(function (emoji) {
92
+ return emoji.type === emojiType;
93
+ });
94
+ if (matchingEmoji) {
95
+ return {
96
+ v: matchingEmoji
97
+ };
98
+ }
99
+ },
100
+ _ret;
101
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
102
+ _ret = _loop();
103
+ if (_ret) return _ret.v;
104
+ }
105
+ } catch (err) {
106
+ _iterator.e(err);
107
+ } finally {
108
+ _iterator.f();
109
+ }
110
+ }
111
+
83
112
  // Priority is always to source from the last emoji set (last overrides first)
84
113
  return emojis[emojis.length - 1];
85
114
  }
@@ -189,8 +218,8 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
189
218
  */
190
219
  }, {
191
220
  key: "findByShortName",
192
- value: function findByShortName(shortName) {
193
- return findByKey(this.shortNameMap, shortName);
221
+ value: function findByShortName(shortName, emojiProviderLookupOrder) {
222
+ return findByKey(this.shortNameMap, shortName, emojiProviderLookupOrder);
194
223
  }
195
224
 
196
225
  /**
@@ -275,17 +275,18 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
275
275
  }, {
276
276
  key: "fetchByEmojiId",
277
277
  value: function () {
278
- var _fetchByEmojiId = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(emojiId, optimistic) {
279
- var _emoji, provider, loader, loadEmoji, _emoji2, emoji, _t3;
278
+ var _fetchByEmojiId = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(emojiId, optimistic, emojiProviderLookupOrder) {
279
+ var shortNameLookupOrder, _emoji, provider, loader, loadEmoji, _emoji2, emoji, _t3;
280
280
  return _regenerator.default.wrap(function (_context4) {
281
281
  while (1) switch (_context4.prev = _context4.next) {
282
282
  case 0:
283
+ shortNameLookupOrder = (0, _platformFeatureFlags.fg)('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined; // Check if repository exists and emoji is defined.
283
284
  if (!(this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository))) {
284
285
  _context4.next = 3;
285
286
  break;
286
287
  }
287
288
  _context4.next = 1;
288
- return this.findByEmojiId(emojiId);
289
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
289
290
  case 1:
290
291
  _emoji = _context4.sent;
291
292
  if (!_emoji) {
@@ -330,7 +331,7 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
330
331
  _context4.prev = 8;
331
332
  _t3 = _context4["catch"](4);
332
333
  _context4.next = 9;
333
- return this.findByEmojiId(emojiId);
334
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
334
335
  case 9:
335
336
  _emoji2 = _context4.sent;
336
337
  if (_emoji2) {
@@ -342,7 +343,7 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
342
343
  return _context4.abrupt("return", this.getMediaEmojiDescriptionURLWithInlineToken(_emoji2));
343
344
  case 11:
344
345
  _context4.next = 12;
345
- return this.findByEmojiId(emojiId);
346
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
346
347
  case 12:
347
348
  emoji = _context4.sent;
348
349
  if (emoji) {
@@ -358,7 +359,7 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
358
359
  }
359
360
  }, _callee4, this, [[4, 8]]);
360
361
  }));
361
- function fetchByEmojiId(_x3, _x4) {
362
+ function fetchByEmojiId(_x3, _x4, _x5) {
362
363
  return _fetchByEmojiId.apply(this, arguments);
363
364
  }
364
365
  return fetchByEmojiId;
@@ -507,7 +508,7 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
507
508
  }
508
509
  }, _callee5, this);
509
510
  }));
510
- function getMediaEmojiDescriptionURLWithInlineToken(_x5) {
511
+ function getMediaEmojiDescriptionURLWithInlineToken(_x6) {
511
512
  return _getMediaEmojiDescriptionURLWithInlineToken.apply(this, arguments);
512
513
  }
513
514
  return getMediaEmojiDescriptionURLWithInlineToken;
@@ -564,19 +565,19 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
564
565
  }
565
566
  }, {
566
567
  key: "findByShortName",
567
- value: function findByShortName(shortName) {
568
+ value: function findByShortName(shortName, emojiProviderLookupOrder) {
568
569
  var _this4 = this;
569
570
  if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
570
571
  // Wait for all emoji to load before looking by shortName (to ensure correct priority)
571
- return this.emojiRepository.findByShortName(shortName);
572
+ return this.emojiRepository.findByShortName(shortName, emojiProviderLookupOrder);
572
573
  }
573
574
  return this.retryIfLoading(function () {
574
- return _this4.findByShortName(shortName);
575
+ return _this4.findByShortName(shortName, emojiProviderLookupOrder);
575
576
  }, undefined);
576
577
  }
577
578
  }, {
578
579
  key: "findByEmojiId",
579
- value: function findByEmojiId(emojiId) {
580
+ value: function findByEmojiId(emojiId, emojiProviderLookupOrder) {
580
581
  var _this5 = this;
581
582
  var id = emojiId.id,
582
583
  shortName = emojiId.shortName;
@@ -594,7 +595,7 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
594
595
  if (!emoji) {
595
596
  // if not, fallback to searching by shortName to
596
597
  // at least render an alternative
597
- return _this5.findByShortName(shortName);
598
+ return _this5.findByShortName(shortName, emojiProviderLookupOrder);
598
599
  }
599
600
  _this5.addUnknownEmoji(emoji);
600
601
  return emoji;
@@ -603,15 +604,15 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
603
604
 
604
605
  // if not, fallback to searching by shortName to
605
606
  // at least render an alternative
606
- return this.findByShortName(shortName);
607
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
607
608
  }
608
609
  } else {
609
610
  // no id fallback to shortName
610
- return this.findByShortName(shortName);
611
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
611
612
  }
612
613
  }
613
614
  return this.retryIfLoading(function () {
614
- return _this5.findByEmojiId(emojiId);
615
+ return _this5.findByEmojiId(emojiId, emojiProviderLookupOrder);
615
616
  }, undefined);
616
617
  }
617
618
  }, {
@@ -40,6 +40,7 @@ var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEm
40
40
  var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
41
41
  var emojiProvider = _ref.emojiProvider,
42
42
  emojiId = _ref.emojiId,
43
+ emojiProviderLookupOrder = _ref.emojiProviderLookupOrder,
43
44
  _ref$showTooltip = _ref.showTooltip,
44
45
  showTooltip = _ref$showTooltip === void 0 ? false : _ref$showTooltip,
45
46
  _ref$customFallback = _ref.customFallback,
@@ -109,7 +110,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
109
110
  }) : emojiId; // A shortName-only optimistic request can resolve without an emoji before the catalogue loads.
110
111
  // Use the non-optimistic path so it waits for the catalogue and tokenizes custom emoji media.
111
112
  shouldFetchOptimistically = useUnicodeEmojis ? optimisticFetch && Boolean(emojiId.id) : optimisticFetch;
112
- foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically);
113
+ foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically, (0, _platformFeatureFlags.fg)('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined);
113
114
  (0, _sampledUfoRenderedEmoji.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_START);
114
115
  if ((0, _isPromise.isPromise)(foundEmoji)) {
115
116
  setLoaded(false);
@@ -166,7 +167,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
166
167
  return function (_x, _x2) {
167
168
  return _ref2.apply(this, arguments);
168
169
  };
169
- }(), [onEmojiLoadFail]);
170
+ }(), [emojiProviderLookupOrder, onEmojiLoadFail]);
170
171
  (0, _react.useEffect)(function () {
171
172
  if (!emojiId) {
172
173
  return;
package/dist/cjs/types.js CHANGED
@@ -11,6 +11,11 @@ exports.UfoExperienceName = exports.UfoEmojiTimingsKeys = exports.UfoEmojiTiming
11
11
  * If not emoji can be found by id (e.g. a custom emoji has been removed),
12
12
  * fallback behaviour will be to attempt to find a matching emoji by shortName.
13
13
  */
14
+ /**
15
+ * Preferred emoji provider type order when resolving an emoji by shortName.
16
+ * The first matching type wins. If no provided type matches, lookup falls back
17
+ * to the default provider ordering.
18
+ */
14
19
  /**
15
20
  * Sprite representation exposed from the EmojiResource.
16
21
  */
@@ -19,7 +19,7 @@ var createEvent = exports.createEvent = function createEvent(eventType, action,
19
19
  actionSubjectId: actionSubjectId,
20
20
  attributes: _objectSpread({
21
21
  packageName: "@atlaskit/emoji",
22
- packageVersion: "72.0.7"
22
+ packageVersion: "72.0.9"
23
23
  }, attributes)
24
24
  };
25
25
  };
@@ -49,9 +49,18 @@ const addAllVariants = (emoji, fnKey, map) => {
49
49
  }
50
50
  }
51
51
  };
52
- const findByKey = (map, key) => {
52
+ const findByKey = (map, key, emojiProviderLookupOrder) => {
53
53
  const emojis = map.get(key);
54
54
  if (emojis && emojis.length) {
55
+ if (emojiProviderLookupOrder !== null && emojiProviderLookupOrder !== void 0 && emojiProviderLookupOrder.length) {
56
+ for (const emojiType of emojiProviderLookupOrder) {
57
+ const matchingEmoji = emojis.find(emoji => emoji.type === emojiType);
58
+ if (matchingEmoji) {
59
+ return matchingEmoji;
60
+ }
61
+ }
62
+ }
63
+
55
64
  // Priority is always to source from the last emoji set (last overrides first)
56
65
  return emojis[emojis.length - 1];
57
66
  }
@@ -152,8 +161,8 @@ export default class EmojiRepository {
152
161
  /**
153
162
  * Returns the first matching emoji matching the shortName, or null if none found.
154
163
  */
155
- findByShortName(shortName) {
156
- return findByKey(this.shortNameMap, shortName);
164
+ findByShortName(shortName, emojiProviderLookupOrder) {
165
+ return findByKey(this.shortNameMap, shortName, emojiProviderLookupOrder);
157
166
  }
158
167
 
159
168
  /**
@@ -163,10 +163,12 @@ export class EmojiResource extends AbstractResource {
163
163
  onlyFetchOnDemand() {
164
164
  return this.fetchOnDemand;
165
165
  }
166
- async fetchByEmojiId(emojiId, optimistic) {
166
+ async fetchByEmojiId(emojiId, optimistic, emojiProviderLookupOrder) {
167
+ const shortNameLookupOrder = fg('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined;
168
+
167
169
  // Check if repository exists and emoji is defined.
168
170
  if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
169
- const emoji = await this.findByEmojiId(emojiId);
171
+ const emoji = await this.findByEmojiId(emojiId, shortNameLookupOrder);
170
172
  if (emoji) {
171
173
  return await this.getMediaEmojiDescriptionURLWithInlineToken(emoji);
172
174
  }
@@ -190,14 +192,14 @@ export class EmojiResource extends AbstractResource {
190
192
  }
191
193
  return this.getMediaEmojiDescriptionURLWithInlineToken(loadEmoji.emojis[0]);
192
194
  } catch {
193
- const emoji = await this.findByEmojiId(emojiId);
195
+ const emoji = await this.findByEmojiId(emojiId, shortNameLookupOrder);
194
196
  if (!emoji) {
195
197
  return;
196
198
  }
197
199
  return this.getMediaEmojiDescriptionURLWithInlineToken(emoji);
198
200
  }
199
201
  }
200
- const emoji = await this.findByEmojiId(emojiId);
202
+ const emoji = await this.findByEmojiId(emojiId, shortNameLookupOrder);
201
203
  if (!emoji) {
202
204
  return;
203
205
  }
@@ -361,14 +363,14 @@ export class EmojiResource extends AbstractResource {
361
363
  this.notifyNotReady();
362
364
  }
363
365
  }
364
- findByShortName(shortName) {
366
+ findByShortName(shortName, emojiProviderLookupOrder) {
365
367
  if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
366
368
  // Wait for all emoji to load before looking by shortName (to ensure correct priority)
367
- return this.emojiRepository.findByShortName(shortName);
369
+ return this.emojiRepository.findByShortName(shortName, emojiProviderLookupOrder);
368
370
  }
369
- return this.retryIfLoading(() => this.findByShortName(shortName), undefined);
371
+ return this.retryIfLoading(() => this.findByShortName(shortName, emojiProviderLookupOrder), undefined);
370
372
  }
371
- findByEmojiId(emojiId) {
373
+ findByEmojiId(emojiId, emojiProviderLookupOrder) {
372
374
  const {
373
375
  id,
374
376
  shortName
@@ -387,7 +389,7 @@ export class EmojiResource extends AbstractResource {
387
389
  if (!emoji) {
388
390
  // if not, fallback to searching by shortName to
389
391
  // at least render an alternative
390
- return this.findByShortName(shortName);
392
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
391
393
  }
392
394
  this.addUnknownEmoji(emoji);
393
395
  return emoji;
@@ -396,14 +398,14 @@ export class EmojiResource extends AbstractResource {
396
398
 
397
399
  // if not, fallback to searching by shortName to
398
400
  // at least render an alternative
399
- return this.findByShortName(shortName);
401
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
400
402
  }
401
403
  } else {
402
404
  // no id fallback to shortName
403
- return this.findByShortName(shortName);
405
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
404
406
  }
405
407
  }
406
- return this.retryIfLoading(() => this.findByEmojiId(emojiId), undefined);
408
+ return this.retryIfLoading(() => this.findByEmojiId(emojiId, emojiProviderLookupOrder), undefined);
407
409
  }
408
410
  findById(id) {
409
411
  if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
@@ -25,6 +25,7 @@ var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEm
25
25
  export const ResourcedEmojiComponent = ({
26
26
  emojiProvider,
27
27
  emojiId,
28
+ emojiProviderLookupOrder,
28
29
  showTooltip = false,
29
30
  customFallback = undefined,
30
31
  fitToHeight = defaultEmojiHeight,
@@ -67,7 +68,7 @@ export const ResourcedEmojiComponent = ({
67
68
  // A shortName-only optimistic request can resolve without an emoji before the catalogue loads.
68
69
  // Use the non-optimistic path so it waits for the catalogue and tokenizes custom emoji media.
69
70
  const shouldFetchOptimistically = useUnicodeEmojis ? optimisticFetch && Boolean(emojiId.id) : optimisticFetch;
70
- const foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically);
71
+ const foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically, fg('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined);
71
72
  sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
72
73
  if (isPromise(foundEmoji)) {
73
74
  setLoaded(false);
@@ -115,7 +116,7 @@ export const ResourcedEmojiComponent = ({
115
116
  setLoaded(true);
116
117
  sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_END);
117
118
  }
118
- }, [onEmojiLoadFail]);
119
+ }, [emojiProviderLookupOrder, onEmojiLoadFail]);
119
120
  useEffect(() => {
120
121
  if (!emojiId) {
121
122
  return;
@@ -6,6 +6,12 @@
6
6
  * fallback behaviour will be to attempt to find a matching emoji by shortName.
7
7
  */
8
8
 
9
+ /**
10
+ * Preferred emoji provider type order when resolving an emoji by shortName.
11
+ * The first matching type wins. If no provided type matches, lookup falls back
12
+ * to the default provider ordering.
13
+ */
14
+
9
15
  /**
10
16
  * Sprite representation exposed from the EmojiResource.
11
17
  */
@@ -7,7 +7,7 @@ export const createEvent = (eventType, action, actionSubject, actionSubjectId, a
7
7
  actionSubjectId,
8
8
  attributes: {
9
9
  packageName: "@atlaskit/emoji",
10
- packageVersion: "72.0.7",
10
+ packageVersion: "72.0.9",
11
11
  ...attributes
12
12
  }
13
13
  });
@@ -2,6 +2,9 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
5
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
6
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
7
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
8
  /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
6
9
  import { Search, UnorderedSearchIndex } from 'js-search';
7
10
  import FeatureGates from '@atlaskit/feature-gate-js-client';
@@ -64,9 +67,36 @@ var _addAllVariants = function addAllVariants(emoji, fnKey, map) {
64
67
  }
65
68
  }
66
69
  };
67
- var findByKey = function findByKey(map, key) {
70
+ var findByKey = function findByKey(map, key, emojiProviderLookupOrder) {
68
71
  var emojis = map.get(key);
69
72
  if (emojis && emojis.length) {
73
+ if (emojiProviderLookupOrder !== null && emojiProviderLookupOrder !== void 0 && emojiProviderLookupOrder.length) {
74
+ var _iterator = _createForOfIteratorHelper(emojiProviderLookupOrder),
75
+ _step;
76
+ try {
77
+ var _loop = function _loop() {
78
+ var emojiType = _step.value;
79
+ var matchingEmoji = emojis.find(function (emoji) {
80
+ return emoji.type === emojiType;
81
+ });
82
+ if (matchingEmoji) {
83
+ return {
84
+ v: matchingEmoji
85
+ };
86
+ }
87
+ },
88
+ _ret;
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ _ret = _loop();
91
+ if (_ret) return _ret.v;
92
+ }
93
+ } catch (err) {
94
+ _iterator.e(err);
95
+ } finally {
96
+ _iterator.f();
97
+ }
98
+ }
99
+
70
100
  // Priority is always to source from the last emoji set (last overrides first)
71
101
  return emojis[emojis.length - 1];
72
102
  }
@@ -176,8 +206,8 @@ var EmojiRepository = /*#__PURE__*/function () {
176
206
  */
177
207
  }, {
178
208
  key: "findByShortName",
179
- value: function findByShortName(shortName) {
180
- return findByKey(this.shortNameMap, shortName);
209
+ value: function findByShortName(shortName, emojiProviderLookupOrder) {
210
+ return findByKey(this.shortNameMap, shortName, emojiProviderLookupOrder);
181
211
  }
182
212
 
183
213
  /**
@@ -263,17 +263,18 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
263
263
  }, {
264
264
  key: "fetchByEmojiId",
265
265
  value: function () {
266
- var _fetchByEmojiId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(emojiId, optimistic) {
267
- var _emoji, provider, loader, loadEmoji, _emoji2, emoji, _t3;
266
+ var _fetchByEmojiId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(emojiId, optimistic, emojiProviderLookupOrder) {
267
+ var shortNameLookupOrder, _emoji, provider, loader, loadEmoji, _emoji2, emoji, _t3;
268
268
  return _regeneratorRuntime.wrap(function (_context4) {
269
269
  while (1) switch (_context4.prev = _context4.next) {
270
270
  case 0:
271
+ shortNameLookupOrder = fg('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined; // Check if repository exists and emoji is defined.
271
272
  if (!(this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository))) {
272
273
  _context4.next = 3;
273
274
  break;
274
275
  }
275
276
  _context4.next = 1;
276
- return this.findByEmojiId(emojiId);
277
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
277
278
  case 1:
278
279
  _emoji = _context4.sent;
279
280
  if (!_emoji) {
@@ -318,7 +319,7 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
318
319
  _context4.prev = 8;
319
320
  _t3 = _context4["catch"](4);
320
321
  _context4.next = 9;
321
- return this.findByEmojiId(emojiId);
322
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
322
323
  case 9:
323
324
  _emoji2 = _context4.sent;
324
325
  if (_emoji2) {
@@ -330,7 +331,7 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
330
331
  return _context4.abrupt("return", this.getMediaEmojiDescriptionURLWithInlineToken(_emoji2));
331
332
  case 11:
332
333
  _context4.next = 12;
333
- return this.findByEmojiId(emojiId);
334
+ return this.findByEmojiId(emojiId, shortNameLookupOrder);
334
335
  case 12:
335
336
  emoji = _context4.sent;
336
337
  if (emoji) {
@@ -346,7 +347,7 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
346
347
  }
347
348
  }, _callee4, this, [[4, 8]]);
348
349
  }));
349
- function fetchByEmojiId(_x3, _x4) {
350
+ function fetchByEmojiId(_x3, _x4, _x5) {
350
351
  return _fetchByEmojiId.apply(this, arguments);
351
352
  }
352
353
  return fetchByEmojiId;
@@ -495,7 +496,7 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
495
496
  }
496
497
  }, _callee5, this);
497
498
  }));
498
- function getMediaEmojiDescriptionURLWithInlineToken(_x5) {
499
+ function getMediaEmojiDescriptionURLWithInlineToken(_x6) {
499
500
  return _getMediaEmojiDescriptionURLWithInlineToken.apply(this, arguments);
500
501
  }
501
502
  return getMediaEmojiDescriptionURLWithInlineToken;
@@ -552,19 +553,19 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
552
553
  }
553
554
  }, {
554
555
  key: "findByShortName",
555
- value: function findByShortName(shortName) {
556
+ value: function findByShortName(shortName, emojiProviderLookupOrder) {
556
557
  var _this4 = this;
557
558
  if (this.isLoaded() && this.isRepositoryAvailable(this.emojiRepository)) {
558
559
  // Wait for all emoji to load before looking by shortName (to ensure correct priority)
559
- return this.emojiRepository.findByShortName(shortName);
560
+ return this.emojiRepository.findByShortName(shortName, emojiProviderLookupOrder);
560
561
  }
561
562
  return this.retryIfLoading(function () {
562
- return _this4.findByShortName(shortName);
563
+ return _this4.findByShortName(shortName, emojiProviderLookupOrder);
563
564
  }, undefined);
564
565
  }
565
566
  }, {
566
567
  key: "findByEmojiId",
567
- value: function findByEmojiId(emojiId) {
568
+ value: function findByEmojiId(emojiId, emojiProviderLookupOrder) {
568
569
  var _this5 = this;
569
570
  var id = emojiId.id,
570
571
  shortName = emojiId.shortName;
@@ -582,7 +583,7 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
582
583
  if (!emoji) {
583
584
  // if not, fallback to searching by shortName to
584
585
  // at least render an alternative
585
- return _this5.findByShortName(shortName);
586
+ return _this5.findByShortName(shortName, emojiProviderLookupOrder);
586
587
  }
587
588
  _this5.addUnknownEmoji(emoji);
588
589
  return emoji;
@@ -591,15 +592,15 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
591
592
 
592
593
  // if not, fallback to searching by shortName to
593
594
  // at least render an alternative
594
- return this.findByShortName(shortName);
595
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
595
596
  }
596
597
  } else {
597
598
  // no id fallback to shortName
598
- return this.findByShortName(shortName);
599
+ return this.findByShortName(shortName, emojiProviderLookupOrder);
599
600
  }
600
601
  }
601
602
  return this.retryIfLoading(function () {
602
- return _this5.findByEmojiId(emojiId);
603
+ return _this5.findByEmojiId(emojiId, emojiProviderLookupOrder);
603
604
  }, undefined);
604
605
  }
605
606
  }, {
@@ -31,6 +31,7 @@ var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEm
31
31
  export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
32
32
  var emojiProvider = _ref.emojiProvider,
33
33
  emojiId = _ref.emojiId,
34
+ emojiProviderLookupOrder = _ref.emojiProviderLookupOrder,
34
35
  _ref$showTooltip = _ref.showTooltip,
35
36
  showTooltip = _ref$showTooltip === void 0 ? false : _ref$showTooltip,
36
37
  _ref$customFallback = _ref.customFallback,
@@ -100,7 +101,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
100
101
  }) : emojiId; // A shortName-only optimistic request can resolve without an emoji before the catalogue loads.
101
102
  // Use the non-optimistic path so it waits for the catalogue and tokenizes custom emoji media.
102
103
  shouldFetchOptimistically = useUnicodeEmojis ? optimisticFetch && Boolean(emojiId.id) : optimisticFetch;
103
- foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically);
104
+ foundEmoji = _emojiProvider.fetchByEmojiId(normalizedEmojiId, shouldFetchOptimistically, fg('platform_bitbucket_fix_shortname_and_ordering') ? emojiProviderLookupOrder : undefined);
104
105
  sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
105
106
  if (isPromise(foundEmoji)) {
106
107
  setLoaded(false);
@@ -157,7 +158,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
157
158
  return function (_x, _x2) {
158
159
  return _ref2.apply(this, arguments);
159
160
  };
160
- }(), [onEmojiLoadFail]);
161
+ }(), [emojiProviderLookupOrder, onEmojiLoadFail]);
161
162
  useEffect(function () {
162
163
  if (!emojiId) {
163
164
  return;
package/dist/esm/types.js CHANGED
@@ -6,6 +6,12 @@
6
6
  * fallback behaviour will be to attempt to find a matching emoji by shortName.
7
7
  */
8
8
 
9
+ /**
10
+ * Preferred emoji provider type order when resolving an emoji by shortName.
11
+ * The first matching type wins. If no provided type matches, lookup falls back
12
+ * to the default provider ordering.
13
+ */
14
+
9
15
  /**
10
16
  * Sprite representation exposed from the EmojiResource.
11
17
  */
@@ -12,7 +12,7 @@ export var createEvent = function createEvent(eventType, action, actionSubject,
12
12
  actionSubjectId: actionSubjectId,
13
13
  attributes: _objectSpread({
14
14
  packageName: "@atlaskit/emoji",
15
- packageVersion: "72.0.7"
15
+ packageVersion: "72.0.9"
16
16
  }, attributes)
17
17
  };
18
18
  };
@@ -1,5 +1,5 @@
1
1
  import type { CategoryId } from '../components/picker/categories';
2
- import { type EmojiDescription, type EmojiSearchResult, type OptionalEmojiDescription, type SearchOptions } from '../types';
2
+ import { type EmojiDescription, type EmojiProviderLookupOrder, type EmojiSearchResult, type OptionalEmojiDescription, type SearchOptions } from '../types';
3
3
  import { UsageFrequencyTracker } from './internal/UsageFrequencyTracker';
4
4
  export default class EmojiRepository {
5
5
  private emojis;
@@ -33,7 +33,7 @@ export default class EmojiRepository {
33
33
  /**
34
34
  * Returns the first matching emoji matching the shortName, or null if none found.
35
35
  */
36
- findByShortName(shortName: string): OptionalEmojiDescription;
36
+ findByShortName(shortName: string, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescription;
37
37
  /**
38
38
  * Returns the first matching emoji matching the id, or null if none found.
39
39
  */
@@ -1,6 +1,6 @@
1
1
  import { AbstractResource, type OnProviderChange, type ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import type { CategoryId } from '../components/picker/categories';
3
- import { type EmojiDescription, type EmojiId, type EmojiProvider, type EmojiResponse, type EmojiSearchResult, type EmojiUpload, type OptionalEmojiDescription, type OptionalEmojiDescriptionWithVariations, type OptionalUser, type SearchOptions, type ToneSelection, type UploadingEmojiProvider, type User } from '../types';
3
+ import { type EmojiDescription, type EmojiId, type EmojiProvider, type EmojiProviderLookupOrder, type EmojiResponse, type EmojiSearchResult, type EmojiUpload, type OptionalEmojiDescription, type OptionalEmojiDescriptionWithVariations, type OptionalUser, type SearchOptions, type ToneSelection, type UploadingEmojiProvider, type User } from '../types';
4
4
  import EmojiRepository from './EmojiRepository';
5
5
  import type { OptimisticImageApiLoaderConfig, Options, SingleEmojiApiLoaderConfig, EmojiLoadSuccessCallback, EmojiLoadFailCallback } from './EmojiUtils';
6
6
  import SiteEmojiResource from './media/SiteEmojiResource';
@@ -97,7 +97,7 @@ export declare class EmojiResource extends AbstractResource<string, EmojiSearchR
97
97
  private fetchIndividualProvider;
98
98
  fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
99
99
  onlyFetchOnDemand(): boolean;
100
- fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): Promise<OptionalEmojiDescriptionWithVariations>;
100
+ fetchByEmojiId(emojiId: EmojiId, optimistic: boolean, emojiProviderLookupOrder?: EmojiProviderLookupOrder): Promise<OptionalEmojiDescriptionWithVariations>;
101
101
  private getProviderType;
102
102
  protected initEmojiRepository(emojiResponses: EmojiResponse[]): void;
103
103
  protected initSiteEmojiResource(emojiResponse: EmojiResponse, provider: ServiceConfig): Promise<void>;
@@ -116,8 +116,8 @@ export declare class EmojiResource extends AbstractResource<string, EmojiSearchR
116
116
  loadMediaEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
117
117
  optimisticMediaRendering(emoji: EmojiDescription, useAlt?: boolean): boolean;
118
118
  filter(query?: string, options?: SearchOptions): void;
119
- findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
120
- findByEmojiId(emojiId: EmojiId): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
119
+ findByShortName(shortName: string, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
120
+ findByEmojiId(emojiId: EmojiId, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
121
121
  findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
122
122
  /**
123
123
  * Synchronously reads the emoji type from the local cache for the given emojiId.
@@ -7,7 +7,7 @@ import React from 'react';
7
7
  import type { StrictXCSSProp } from '@atlaskit/css';
8
8
  import type { EmojiProvider } from '../../api/EmojiResource';
9
9
  import type { EmojiLoadSuccessCallback, EmojiLoadFailCallback } from '../../api/EmojiUtils';
10
- import { type EmojiId } from '../../types';
10
+ import { type EmojiId, type EmojiProviderLookupOrder } from '../../types';
11
11
  export interface BaseResourcedEmojiProps {
12
12
  /**
13
13
  * Custom Fallback allows a custom element or string to be rendered if an emoji fails to be fetched or found.
@@ -27,6 +27,11 @@ export interface BaseResourcedEmojiProps {
27
27
  * Emoji to display
28
28
  */
29
29
  emojiId: EmojiId;
30
+ /**
31
+ * Preferred emoji provider type order when resolving shortName-only emoji.
32
+ * The first matching type wins.
33
+ */
34
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder;
30
35
  /**
31
36
  * Scales the emoji proportionally to provided hight.
32
37
  * Defaults to `undefined`.
@@ -85,5 +90,5 @@ export interface Props extends BaseResourcedEmojiProps {
85
90
  */
86
91
  onEmojiLoadSuccess?: EmojiLoadSuccessCallback;
87
92
  }
88
- export declare const ResourcedEmojiComponent: ({ emojiProvider, emojiId, showTooltip, customFallback, fitToHeight, ignoreWrapper, optimistic, optimisticImageURL, editorEmoji, renderUnicodeEmojiAsImage, pageTitleEmoji, placeholderXcss, onEmojiLoadSuccess, onEmojiLoadFail, }: Props) => React.JSX.Element;
93
+ export declare const ResourcedEmojiComponent: ({ emojiProvider, emojiId, emojiProviderLookupOrder, showTooltip, customFallback, fitToHeight, ignoreWrapper, optimistic, optimisticImageURL, editorEmoji, renderUnicodeEmojiAsImage, pageTitleEmoji, placeholderXcss, onEmojiLoadSuccess, onEmojiLoadFail, }: Props) => React.JSX.Element;
89
94
  export default ResourcedEmojiComponent;
@@ -7,6 +7,7 @@ export { default as EmojiResource } from './api/EmojiResource';
7
7
  * @deprecated Use `import type { EmojiProvider, UploadingEmojiProvider, EmojiResourceConfig, OnEmojiProviderChange } from '@atlaskit/emoji/emoji-resource'` instead.
8
8
  */
9
9
  export type { EmojiProvider, UploadingEmojiProvider, EmojiResourceConfig, OnEmojiProviderChange, } from './api/EmojiResource';
10
+ export type { EmojiProviderLookupOrder } from './types';
10
11
  /**
11
12
  * @deprecated Use `import type { EmojiLoadSuccessCallback, EmojiLoadFailCallback } from '@atlaskit/emoji/emoji-utils'` instead.
12
13
  */
@@ -31,7 +31,7 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
31
31
  *
32
32
  * If the interface is not defined it will fail gracefully to findByEmojiId
33
33
  */
34
- fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): OptionalEmojiDescriptionWithVariations | Promise<OptionalEmojiDescriptionWithVariations>;
34
+ fetchByEmojiId(emojiId: EmojiId, optimistic: boolean, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescriptionWithVariations | Promise<OptionalEmojiDescriptionWithVariations>;
35
35
  /**
36
36
  * Fetches and returns emojiResource
37
37
  */
@@ -43,7 +43,7 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
43
43
  *
44
44
  * Will load media api images before returning.
45
45
  */
46
- findByEmojiId(emojiId: EmojiId): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
46
+ findByEmojiId(emojiId: EmojiId, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
47
47
  /**
48
48
  * Return the emoji that matches the supplied id or undefined. As with findByEmojiId, this call should load
49
49
  * the media api images before returning.
@@ -54,7 +54,7 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
54
54
  *
55
55
  * Will load media api images before returning.
56
56
  */
57
- findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
57
+ findByShortName(shortName: string, emojiProviderLookupOrder?: EmojiProviderLookupOrder): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
58
58
  /**
59
59
  * Finds emojis belonging to specified category.
60
60
  *
@@ -65,6 +65,17 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
65
65
  * Returns a map matching ascii representations to their corresponding EmojiDescription.
66
66
  */
67
67
  getAsciiMap(): Promise<Map<string, EmojiDescription>>;
68
+ /**
69
+ * Synchronously reads the emoji type (e.g. 'STANDARD', 'SITE', 'ATLASSIAN') from the
70
+ * local cache for the given emojiId, without making any network requests.
71
+ *
72
+ * Returns `undefined` when the emoji is not yet in the cache or no repository has been
73
+ * initialised. This is an optional method — callers must fall back gracefully when it is
74
+ * absent (e.g. in mock or legacy providers).
75
+ *
76
+ * Optional.
77
+ */
78
+ getCachedEmojiType?(emojiId: EmojiId): string | undefined;
68
79
  /**
69
80
  * Returns the logged user passed by the Product
70
81
  */
@@ -81,17 +92,6 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
81
92
  * Returns a constructed URL to fetch emoji media asset if 'optimisticImageApi' config has been provided
82
93
  */
83
94
  getOptimisticImageURL(emojiId: EmojiId): string | undefined;
84
- /**
85
- * Synchronously reads the emoji type (e.g. 'STANDARD', 'SITE', 'ATLASSIAN') from the
86
- * local cache for the given emojiId, without making any network requests.
87
- *
88
- * Returns `undefined` when the emoji is not yet in the cache or no repository has been
89
- * initialised. This is an optional method — callers must fall back gracefully when it is
90
- * absent (e.g. in mock or legacy providers).
91
- *
92
- * Optional.
93
- */
94
- getCachedEmojiType?(emojiId: EmojiId): string | undefined;
95
95
  /**
96
96
  * Used by the picker and typeahead to obtain a skin tone preference
97
97
  * if the user has previously selected one via the Tone Selector
@@ -176,6 +176,12 @@ export interface EmojiId {
176
176
  id?: string;
177
177
  shortName: string;
178
178
  }
179
+ /**
180
+ * Preferred emoji provider type order when resolving an emoji by shortName.
181
+ * The first matching type wins. If no provided type matches, lookup falls back
182
+ * to the default provider ordering.
183
+ */
184
+ export type EmojiProviderLookupOrder = string[];
179
185
  export interface SpriteSheet {
180
186
  column: number;
181
187
  height: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "72.0.8",
3
+ "version": "72.1.0",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,30 +32,30 @@
32
32
  "@atlaskit/afm-i18n-platform-elements-emoji": "2.200.0",
33
33
  "@atlaskit/analytics-next": "^12.3.0",
34
34
  "@atlaskit/browser-apis": "^1.2.0",
35
- "@atlaskit/button": "^25.1.0",
35
+ "@atlaskit/button": "^25.2.0",
36
36
  "@atlaskit/css": "^1.0.0",
37
37
  "@atlaskit/feature-gate-js-client": "^6.0.0",
38
- "@atlaskit/form": "^17.0.0",
39
- "@atlaskit/heading": "^7.0.0",
40
- "@atlaskit/icon": "^37.4.0",
41
- "@atlaskit/icon-lab": "^7.6.0",
42
- "@atlaskit/image": "^5.0.0",
43
- "@atlaskit/logo": "^21.4.0",
44
- "@atlaskit/media-client": "^37.3.0",
45
- "@atlaskit/media-client-react": "^6.1.0",
38
+ "@atlaskit/form": "^17.1.0",
39
+ "@atlaskit/heading": "^7.1.0",
40
+ "@atlaskit/icon": "^37.5.0",
41
+ "@atlaskit/icon-lab": "^7.7.0",
42
+ "@atlaskit/image": "^5.1.0",
43
+ "@atlaskit/logo": "^21.5.0",
44
+ "@atlaskit/media-client": "^37.5.0",
45
+ "@atlaskit/media-client-react": "^6.2.0",
46
46
  "@atlaskit/platform-feature-flags": "^2.1.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop": "^3.0.0",
48
- "@atlaskit/primitives": "^22.3.0",
49
- "@atlaskit/radio": "^10.0.0",
50
- "@atlaskit/spinner": "^20.2.0",
51
- "@atlaskit/textfield": "^10.0.0",
52
- "@atlaskit/theme": "^28.0.0",
53
- "@atlaskit/tmp-editor-statsig": "^155.0.0",
54
- "@atlaskit/tokens": "^16.7.0",
55
- "@atlaskit/tooltip": "^24.1.0",
48
+ "@atlaskit/primitives": "^22.4.0",
49
+ "@atlaskit/radio": "^10.1.0",
50
+ "@atlaskit/spinner": "^20.3.0",
51
+ "@atlaskit/textfield": "^10.1.0",
52
+ "@atlaskit/theme": "^28.1.0",
53
+ "@atlaskit/tmp-editor-statsig": "^157.0.0",
54
+ "@atlaskit/tokens": "^16.8.0",
55
+ "@atlaskit/tooltip": "^24.2.0",
56
56
  "@atlaskit/ufo": "^1.0.0",
57
57
  "@atlaskit/util-service-support": "^7.2.0",
58
- "@atlaskit/visually-hidden": "^4.2.0",
58
+ "@atlaskit/visually-hidden": "^4.3.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@compiled/react": "^1.0.2",
61
61
  "@tanstack/react-virtual": "3.0.0-beta.60",
@@ -131,6 +131,10 @@
131
131
  "platform_emoji_keep_picker_open_on_upload": {
132
132
  "type": "boolean"
133
133
  },
134
+ "platform_bitbucket_fix_shortname_and_ordering": {
135
+ "type": "boolean",
136
+ "referenceOnly": true
137
+ },
134
138
  "add_emoji_media_size_to_media_file_upload_request": {
135
139
  "type": "boolean"
136
140
  },
package/report.api.md CHANGED
@@ -48,6 +48,7 @@ export interface AltRepresentations {
48
48
  interface BaseResourcedEmojiProps {
49
49
  customFallback?: JSX.Element | string;
50
50
  emojiId: EmojiId;
51
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder;
51
52
  fitToHeight?: number;
52
53
  optimistic?: boolean;
53
54
  optimisticImageURL?: string;
@@ -170,6 +171,9 @@ export interface EmojiId {
170
171
  shortName: string;
171
172
  }
172
173
 
174
+ // @public
175
+ export type EmojiProviderLookupOrder = string[];
176
+
173
177
  // @public (undocumented)
174
178
  export const emojiImage = 'emoji-common-emoji-image';
175
179
 
@@ -258,11 +262,18 @@ export interface EmojiProvider
258
262
  fetchByEmojiId(
259
263
  emojiId: EmojiId,
260
264
  optimistic: boolean,
265
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
261
266
  ): OptionalEmojiDescriptionWithVariations | Promise<OptionalEmojiDescriptionWithVariations>;
262
267
  fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
263
- findByEmojiId(emojiId: EmojiId): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
268
+ findByEmojiId(
269
+ emojiId: EmojiId,
270
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
271
+ ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
264
272
  findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
265
- findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
273
+ findByShortName(
274
+ shortName: string,
275
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
276
+ ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
266
277
  findInCategory(categoryId: string): Promise<EmojiDescription[]>;
267
278
  getAsciiMap(): Promise<Map<string, EmojiDescription>>;
268
279
  getCurrentUser(): OptionalUser;
@@ -292,7 +303,10 @@ export class EmojiRepository {
292
303
  // (undocumented)
293
304
  findByAsciiRepresentation(asciiEmoji: string): OptionalEmojiDescription;
294
305
  findById(id: string): OptionalEmojiDescription;
295
- findByShortName(shortName: string): OptionalEmojiDescription;
306
+ findByShortName(
307
+ shortName: string,
308
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
309
+ ): OptionalEmojiDescription;
296
310
  // (undocumented)
297
311
  findInCategory(categoryId: CategoryId): EmojiDescription[];
298
312
  // (undocumented)
@@ -352,6 +366,7 @@ class EmojiResource_2
352
366
  fetchByEmojiId(
353
367
  emojiId: EmojiId,
354
368
  optimistic: boolean,
369
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
355
370
  ): Promise<OptionalEmojiDescriptionWithVariations>;
356
371
  // (undocumented)
357
372
  fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
@@ -360,11 +375,17 @@ class EmojiResource_2
360
375
  // (undocumented)
361
376
  filter(query?: string, options?: SearchOptions): void;
362
377
  // (undocumented)
363
- findByEmojiId(emojiId: EmojiId): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
378
+ findByEmojiId(
379
+ emojiId: EmojiId,
380
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
381
+ ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
364
382
  // (undocumented)
365
383
  findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
366
384
  // (undocumented)
367
- findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
385
+ findByShortName(
386
+ shortName: string,
387
+ emojiProviderLookupOrder?: EmojiProviderLookupOrder,
388
+ ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
368
389
  // (undocumented)
369
390
  findInCategory(categoryId: CategoryId): Promise<EmojiDescription[]>;
370
391
  // (undocumented)