@atlaskit/emoji 71.9.7 → 71.9.9

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,19 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 71.9.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 71.9.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`2ec64503b032d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2ec64503b032d) -
14
+ Add teamoji parameter when fetching Atlassian emoji metadata
15
+ - Updated dependencies
16
+
3
17
  ## 71.9.7
4
18
 
5
19
  ### Patch Changes
@@ -15,6 +15,7 @@ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
15
15
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
+ var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
18
19
  var _utilServiceSupport = require("@atlaskit/util-service-support");
19
20
  var _constants = require("../util/constants");
20
21
  var _logger = _interopRequireDefault(require("../util/logger"));
@@ -31,6 +32,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
31
32
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
32
33
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
33
34
  function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
35
+ var teamoji26RefreshEmojiPickerExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
36
+ var teamoji26QueryParam = 'useTeamoji26=true';
37
+ var isTeamoji26RefreshEmojiPickerEnabled = function isTeamoji26RefreshEmojiPickerEnabled() {
38
+ if (!_featureGates.default.initializeCompleted()) {
39
+ return false;
40
+ }
41
+
42
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
43
+ return _featureGates.default.getExperimentValue(teamoji26RefreshEmojiPickerExperimentName, 'isEnabled', false);
44
+ };
45
+ var addTeamoji26QueryParam = function addTeamoji26QueryParam(url) {
46
+ if (!url.includes('/atlassian') || /[?&]useTeamoji26=/.test(url)) {
47
+ return url;
48
+ }
49
+ var hashIndex = url.indexOf('#');
50
+ var urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
51
+ var hash = hashIndex === -1 ? '' : url.slice(hashIndex);
52
+ var separator = urlWithoutHash.includes('?') ? '&' : '?';
53
+ return "".concat(urlWithoutHash).concat(separator).concat(teamoji26QueryParam).concat(hash);
54
+ };
55
+
34
56
  // Re-exporting to not cause a breaking change
35
57
  // Re-exporting to not cause a breaking change
36
58
 
@@ -71,25 +93,28 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_AbstractReso
71
93
  return url.replace('/gateway/api/emoji', '/gateway/api/elements/emoji');
72
94
  };
73
95
  var stargateEmojiPathEnabled = (0, _platformFeatureFlags.fg)('use-elements-stargate-emoji-path');
96
+ var teamoji26RefreshEmojiPickerEnabled = isTeamoji26RefreshEmojiPickerEnabled();
74
97
  var singleEmojiApi = config.singleEmojiApi;
75
98
  var optimisticImageApi = config.optimisticImageApi;
76
- _this.emojiProviderConfig = stargateEmojiPathEnabled ? _objectSpread(_objectSpread({}, config), {}, {
77
- providers: config.providers.map(function (provider) {
78
- return _objectSpread(_objectSpread({}, provider), {}, {
79
- url: rewriteEmojiGatewayPath(provider.url)
80
- });
81
- }),
82
- singleEmojiApi: singleEmojiApi ? _objectSpread(_objectSpread({}, singleEmojiApi), {}, {
99
+ var providers = config.providers.map(function (provider) {
100
+ var rewrittenUrl = stargateEmojiPathEnabled ? rewriteEmojiGatewayPath(provider.url) : provider.url;
101
+ return _objectSpread(_objectSpread({}, provider), {}, {
102
+ url: teamoji26RefreshEmojiPickerEnabled ? addTeamoji26QueryParam(rewrittenUrl) : rewrittenUrl
103
+ });
104
+ });
105
+ _this.emojiProviderConfig = _objectSpread(_objectSpread({}, config), {}, {
106
+ providers: providers,
107
+ singleEmojiApi: stargateEmojiPathEnabled && singleEmojiApi ? _objectSpread(_objectSpread({}, singleEmojiApi), {}, {
83
108
  getUrl: function getUrl(emojiId) {
84
109
  return rewriteEmojiGatewayPath(singleEmojiApi.getUrl(emojiId));
85
110
  }
86
- }) : undefined,
87
- optimisticImageApi: optimisticImageApi ? _objectSpread(_objectSpread({}, optimisticImageApi), {}, {
111
+ }) : singleEmojiApi,
112
+ optimisticImageApi: stargateEmojiPathEnabled && optimisticImageApi ? _objectSpread(_objectSpread({}, optimisticImageApi), {}, {
88
113
  getUrl: function getUrl(emojiId) {
89
114
  return rewriteEmojiGatewayPath(optimisticImageApi.getUrl(emojiId));
90
115
  }
91
- }) : undefined
92
- }) : config;
116
+ }) : optimisticImageApi
117
+ });
93
118
  _this.recordConfig = config.recordConfig;
94
119
  _this.currentUser = config.currentUser;
95
120
  if ((0, _storageAvailable.default)('localStorage')) {
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
20
20
  actionSubjectId: actionSubjectId,
21
21
  attributes: _objectSpread({
22
22
  packageName: "@atlaskit/emoji",
23
- packageVersion: "71.9.6"
23
+ packageVersion: "71.9.8"
24
24
  }, attributes)
25
25
  };
26
26
  };
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
3
4
  import { AbstractResource, utils as serviceUtils } from '@atlaskit/util-service-support';
4
5
  import { SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP, selectedToneStorageKey } from '../util/constants';
5
6
  import debug from '../util/logger';
@@ -11,6 +12,26 @@ import EmojiRepository from './EmojiRepository';
11
12
  import SiteEmojiResource from './media/SiteEmojiResource';
12
13
  import { sampledUfoEmojiResourceFetched, ufoExperiences } from '../util/analytics/ufoExperiences';
13
14
  import { promiseWithTimeout } from '../util/timed-promise';
15
+ const teamoji26RefreshEmojiPickerExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
16
+ const teamoji26QueryParam = 'useTeamoji26=true';
17
+ const isTeamoji26RefreshEmojiPickerEnabled = () => {
18
+ if (!FeatureGates.initializeCompleted()) {
19
+ return false;
20
+ }
21
+
22
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
23
+ return FeatureGates.getExperimentValue(teamoji26RefreshEmojiPickerExperimentName, 'isEnabled', false);
24
+ };
25
+ const addTeamoji26QueryParam = url => {
26
+ if (!url.includes('/atlassian') || /[?&]useTeamoji26=/.test(url)) {
27
+ return url;
28
+ }
29
+ const hashIndex = url.indexOf('#');
30
+ const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
31
+ const hash = hashIndex === -1 ? '' : url.slice(hashIndex);
32
+ const separator = urlWithoutHash.includes('?') ? '&' : '?';
33
+ return `${urlWithoutHash}${separator}${teamoji26QueryParam}${hash}`;
34
+ };
14
35
 
15
36
  // Re-exporting to not cause a breaking change
16
37
  // Re-exporting to not cause a breaking change
@@ -46,23 +67,28 @@ export class EmojiResource extends AbstractResource {
46
67
  _defineProperty(this, "isLoaded", () => this.initialLoaders !== 0 && this.activeLoaders === 0);
47
68
  const rewriteEmojiGatewayPath = url => url.replace('/gateway/api/emoji', '/gateway/api/elements/emoji');
48
69
  const stargateEmojiPathEnabled = fg('use-elements-stargate-emoji-path');
70
+ const teamoji26RefreshEmojiPickerEnabled = isTeamoji26RefreshEmojiPickerEnabled();
49
71
  const singleEmojiApi = config.singleEmojiApi;
50
72
  const optimisticImageApi = config.optimisticImageApi;
51
- this.emojiProviderConfig = stargateEmojiPathEnabled ? {
52
- ...config,
53
- providers: config.providers.map(provider => ({
73
+ const providers = config.providers.map(provider => {
74
+ const rewrittenUrl = stargateEmojiPathEnabled ? rewriteEmojiGatewayPath(provider.url) : provider.url;
75
+ return {
54
76
  ...provider,
55
- url: rewriteEmojiGatewayPath(provider.url)
56
- })),
57
- singleEmojiApi: singleEmojiApi ? {
77
+ url: teamoji26RefreshEmojiPickerEnabled ? addTeamoji26QueryParam(rewrittenUrl) : rewrittenUrl
78
+ };
79
+ });
80
+ this.emojiProviderConfig = {
81
+ ...config,
82
+ providers,
83
+ singleEmojiApi: stargateEmojiPathEnabled && singleEmojiApi ? {
58
84
  ...singleEmojiApi,
59
85
  getUrl: emojiId => rewriteEmojiGatewayPath(singleEmojiApi.getUrl(emojiId))
60
- } : undefined,
61
- optimisticImageApi: optimisticImageApi ? {
86
+ } : singleEmojiApi,
87
+ optimisticImageApi: stargateEmojiPathEnabled && optimisticImageApi ? {
62
88
  ...optimisticImageApi,
63
89
  getUrl: emojiId => rewriteEmojiGatewayPath(optimisticImageApi.getUrl(emojiId))
64
- } : undefined
65
- } : config;
90
+ } : optimisticImageApi
91
+ };
66
92
  this.recordConfig = config.recordConfig;
67
93
  this.currentUser = config.currentUser;
68
94
  if (storageAvailable('localStorage')) {
@@ -9,7 +9,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
9
9
  actionSubjectId,
10
10
  attributes: {
11
11
  packageName: "@atlaskit/emoji",
12
- packageVersion: "71.9.6",
12
+ packageVersion: "71.9.8",
13
13
  ...attributes
14
14
  }
15
15
  });
@@ -13,6 +13,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
13
13
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
14
  function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
16
17
  import { AbstractResource, utils as serviceUtils } from '@atlaskit/util-service-support';
17
18
  import { SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP, selectedToneStorageKey } from '../util/constants';
18
19
  import debug from '../util/logger';
@@ -24,6 +25,26 @@ import EmojiRepository from './EmojiRepository';
24
25
  import SiteEmojiResource from './media/SiteEmojiResource';
25
26
  import { sampledUfoEmojiResourceFetched, ufoExperiences } from '../util/analytics/ufoExperiences';
26
27
  import { promiseWithTimeout } from '../util/timed-promise';
28
+ var teamoji26RefreshEmojiPickerExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
29
+ var teamoji26QueryParam = 'useTeamoji26=true';
30
+ var isTeamoji26RefreshEmojiPickerEnabled = function isTeamoji26RefreshEmojiPickerEnabled() {
31
+ if (!FeatureGates.initializeCompleted()) {
32
+ return false;
33
+ }
34
+
35
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
36
+ return FeatureGates.getExperimentValue(teamoji26RefreshEmojiPickerExperimentName, 'isEnabled', false);
37
+ };
38
+ var addTeamoji26QueryParam = function addTeamoji26QueryParam(url) {
39
+ if (!url.includes('/atlassian') || /[?&]useTeamoji26=/.test(url)) {
40
+ return url;
41
+ }
42
+ var hashIndex = url.indexOf('#');
43
+ var urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
44
+ var hash = hashIndex === -1 ? '' : url.slice(hashIndex);
45
+ var separator = urlWithoutHash.includes('?') ? '&' : '?';
46
+ return "".concat(urlWithoutHash).concat(separator).concat(teamoji26QueryParam).concat(hash);
47
+ };
27
48
 
28
49
  // Re-exporting to not cause a breaking change
29
50
  // Re-exporting to not cause a breaking change
@@ -65,25 +86,28 @@ export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
65
86
  return url.replace('/gateway/api/emoji', '/gateway/api/elements/emoji');
66
87
  };
67
88
  var stargateEmojiPathEnabled = fg('use-elements-stargate-emoji-path');
89
+ var teamoji26RefreshEmojiPickerEnabled = isTeamoji26RefreshEmojiPickerEnabled();
68
90
  var singleEmojiApi = config.singleEmojiApi;
69
91
  var optimisticImageApi = config.optimisticImageApi;
70
- _this.emojiProviderConfig = stargateEmojiPathEnabled ? _objectSpread(_objectSpread({}, config), {}, {
71
- providers: config.providers.map(function (provider) {
72
- return _objectSpread(_objectSpread({}, provider), {}, {
73
- url: rewriteEmojiGatewayPath(provider.url)
74
- });
75
- }),
76
- singleEmojiApi: singleEmojiApi ? _objectSpread(_objectSpread({}, singleEmojiApi), {}, {
92
+ var providers = config.providers.map(function (provider) {
93
+ var rewrittenUrl = stargateEmojiPathEnabled ? rewriteEmojiGatewayPath(provider.url) : provider.url;
94
+ return _objectSpread(_objectSpread({}, provider), {}, {
95
+ url: teamoji26RefreshEmojiPickerEnabled ? addTeamoji26QueryParam(rewrittenUrl) : rewrittenUrl
96
+ });
97
+ });
98
+ _this.emojiProviderConfig = _objectSpread(_objectSpread({}, config), {}, {
99
+ providers: providers,
100
+ singleEmojiApi: stargateEmojiPathEnabled && singleEmojiApi ? _objectSpread(_objectSpread({}, singleEmojiApi), {}, {
77
101
  getUrl: function getUrl(emojiId) {
78
102
  return rewriteEmojiGatewayPath(singleEmojiApi.getUrl(emojiId));
79
103
  }
80
- }) : undefined,
81
- optimisticImageApi: optimisticImageApi ? _objectSpread(_objectSpread({}, optimisticImageApi), {}, {
104
+ }) : singleEmojiApi,
105
+ optimisticImageApi: stargateEmojiPathEnabled && optimisticImageApi ? _objectSpread(_objectSpread({}, optimisticImageApi), {}, {
82
106
  getUrl: function getUrl(emojiId) {
83
107
  return rewriteEmojiGatewayPath(optimisticImageApi.getUrl(emojiId));
84
108
  }
85
- }) : undefined
86
- }) : config;
109
+ }) : optimisticImageApi
110
+ });
87
111
  _this.recordConfig = config.recordConfig;
88
112
  _this.currentUser = config.currentUser;
89
113
  if (storageAvailable('localStorage')) {
@@ -14,7 +14,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
14
14
  actionSubjectId: actionSubjectId,
15
15
  attributes: _objectSpread({
16
16
  packageName: "@atlaskit/emoji",
17
- packageVersion: "71.9.6"
17
+ packageVersion: "71.9.8"
18
18
  }, attributes)
19
19
  };
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "71.9.7",
3
+ "version": "71.9.9",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/spinner": "^20.1.0",
51
51
  "@atlaskit/textfield": "^9.1.0",
52
52
  "@atlaskit/theme": "^26.1.0",
53
- "@atlaskit/tmp-editor-statsig": "^126.2.0",
53
+ "@atlaskit/tmp-editor-statsig": "^128.0.0",
54
54
  "@atlaskit/tokens": "^16.0.0",
55
55
  "@atlaskit/tooltip": "^23.1.0",
56
56
  "@atlaskit/ufo": "^1.0.0",